fix bug
This commit is contained in:
parent
363e8ecc23
commit
90782229d5
|
|
@ -593,7 +593,7 @@ bool ReadSensors(SENSOR_data &sensor_data) {
|
||||||
weight_current32 = (int32_t)((weight_current32_a + weight_current32_b) / 5.0);
|
weight_current32 = (int32_t)((weight_current32_a + weight_current32_b) / 5.0);
|
||||||
|
|
||||||
// we check if weights are plausible
|
// we check if weights are plausible
|
||||||
plausible = (weight_current32_a > -10000) && (weight_current32_b > -10000) && (weight_current32_a < -150000) && (weight_current32_b < -150000);
|
plausible = (weight_current32_a > -10000) && (weight_current32_b > -10000) && (weight_current32_a < 150000) && (weight_current32_b < 150000);
|
||||||
|
|
||||||
if (weight_current32 < 0) {
|
if (weight_current32 < 0) {
|
||||||
weight_current32 = 0;
|
weight_current32 = 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue