forked from Archive/PX4-Autopilot
ets_airspeed: cope with zero value from ETS airspeed sensor
This commit is contained in:
parent
043dc4e225
commit
dad76c56c6
|
@ -157,6 +157,14 @@ ETSAirspeed::collect()
|
|||
}
|
||||
|
||||
uint16_t diff_pres_pa = val[1] << 8 | val[0];
|
||||
if (diff_pres_pa == 0) {
|
||||
// a zero value means the pressure sensor cannot give us a
|
||||
// value. We need to return, and not report a value or the
|
||||
// caller could end up using this value as part of an
|
||||
// average
|
||||
log("zero value from sensor");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (diff_pres_pa < _diff_pres_offset + MIN_ACCURATE_DIFF_PRES_PA) {
|
||||
diff_pres_pa = 0;
|
||||
|
|
Loading…
Reference in New Issue