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
+10 -3
View File
@@ -288,13 +288,17 @@ MEASAirspeed::collect()
void
MEASAirspeed::cycle()
{
int ret;
/* collection phase? */
if (_collect_phase) {
/* perform collection */
if (OK != collect()) {
ret = collect();
if (OK != ret) {
/* restart the measurement state machine */
start();
_sensor_ok = false;
return;
}
@@ -318,10 +322,13 @@ MEASAirspeed::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;