mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 15:43:34 +08:00
meas_airspeed: don't use stale/bad data in airspeed reading
also fixed handling of perf counters on error
This commit is contained in:
committed by
Lorenz Meier
parent
fdbc09e2a5
commit
935ed2fe49
@@ -162,6 +162,8 @@ MEASAirspeed::collect()
|
||||
|
||||
if (ret < 0) {
|
||||
log("error reading from sensor: %d", ret);
|
||||
perf_count(_comms_errors);
|
||||
perf_end(_sample_perf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -169,9 +171,14 @@ MEASAirspeed::collect()
|
||||
|
||||
if (status == 2) {
|
||||
log("err: stale data");
|
||||
|
||||
perf_count(_comms_errors);
|
||||
perf_end(_sample_perf);
|
||||
return ret;
|
||||
} else if (status == 3) {
|
||||
log("err: fault");
|
||||
perf_count(_comms_errors);
|
||||
perf_end(_sample_perf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
//uint16_t diff_pres_pa = (val[1]) | ((val[0] & ~(0xC0)) << 8);
|
||||
|
||||
Reference in New Issue
Block a user