AP_InertialSensor: Use return value of blocking_read to handle calibration timeouts

This commit is contained in:
Michael Carpenter 2014-04-17 11:10:11 -04:00 committed by Andrew Tridgell
parent 786661ca2b
commit b4c0e1215b
2 changed files with 5 additions and 2 deletions

View File

@ -419,7 +419,10 @@ bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract* interact
PSTR("Place vehicle %S and press any key.\n"), msg);
// wait for user input
interact->blocking_read();
if (interact->blocking_read()) {
//No need to use interact->printf_P for an error, blocking_read does this when it fails
goto failed;
}
// clear out any existing samples from ins
update();

View File

@ -25,7 +25,7 @@ uint8_t AP_InertialSensor_UserInteract_MAVLink::blocking_read(void)
}
}
hal.console->println_P(PSTR("Timed out waiting for user response"));
return 0;
return 1;
}
void AP_InertialSensor_UserInteract_MAVLink::_printf_P(const prog_char* fmt, ...)