Browse Source

AP_InertialSensor: Use return value of blocking_read to handle calibration timeouts

mission-4.1.18
Michael Carpenter 11 years ago committed by Andrew Tridgell
parent
commit
b4c0e1215b
  1. 5
      libraries/AP_InertialSensor/AP_InertialSensor.cpp
  2. 2
      libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp

5
libraries/AP_InertialSensor/AP_InertialSensor.cpp

@ -419,7 +419,10 @@ bool AP_InertialSensor::calibrate_accel(AP_InertialSensor_UserInteract* interact @@ -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();

2
libraries/AP_InertialSensor/AP_InertialSensor_UserInteract_MAVLink.cpp

@ -25,7 +25,7 @@ uint8_t AP_InertialSensor_UserInteract_MAVLink::blocking_read(void) @@ -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, ...)

Loading…
Cancel
Save