AP_InertialSensor: ensure accel cal completion messages get through

This commit is contained in:
Andrew Tridgell 2015-03-09 07:36:50 +11:00
parent 38bde56523
commit 494e909703

View File

@ -50,7 +50,14 @@ void AP_InertialSensor_UserInteract_MAVLink::_printf_P(const prog_char* fmt, ...
// STATUSTEXT messages should not add linefeed
msg[strlen(msg)-1] = 0;
}
AP_HAL::UARTDriver *uart = _gcs->get_uart();
/*
to ensure these messages get to the user we need to wait for the
port send buffer to have enough room
*/
while (uart->txspace() < MAVLINK_NUM_NON_PAYLOAD_BYTES+MAVLINK_MSG_ID_STATUSTEXT_LEN) {
hal.scheduler->delay(1);
}
_gcs->send_text(SEVERITY_HIGH, msg);
hal.scheduler->delay(10);
}