airspeed driver: Do not spam the console on error, report the system change only once

This commit is contained in:
Lorenz Meier
2014-04-20 21:43:18 +02:00
parent 071f9c648b
commit 709d104de4
4 changed files with 53 additions and 22 deletions
+11 -3
View File
@@ -207,14 +207,18 @@ ETSAirspeed::collect()
void
ETSAirspeed::cycle()
{
int ret;
/* collection phase? */
if (_collect_phase) {
/* perform collection */
if (OK != collect()) {
ret = collect();
if (OK != ret) {
perf_count(_comms_errors);
/* restart the measurement state machine */
start();
_sensor_ok = false;
return;
}
@@ -238,8 +242,12 @@ ETSAirspeed::cycle()
}
/* measurement phase */
if (OK != measure())
log("measure error");
ret = measure();
if (OK != ret) {
debug("measure error");
}
_sensor_ok = (ret == OK);
/* next phase is collection */
_collect_phase = true;