Copter: use prearm_failure_reason()

This commit is contained in:
Andrew Tridgell 2015-09-08 15:51:00 +10:00 committed by Randy Mackay
parent c4d561a4eb
commit 7ca88a26da

View File

@ -646,7 +646,12 @@ bool Copter::pre_arm_gps_checks(bool display_failure)
// ensure GPS is ok
if (!position_ok()) {
if (display_failure) {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Need 3D Fix"));
const char *reason = ahrs.prearm_failure_reason();
if (reason) {
GCS_MAVLINK::send_statustext_all(SEVERITY_HIGH, PSTR("PreArm: %s"), reason);
} else {
gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Need 3D Fix"));
}
}
AP_Notify::flags.pre_arm_gps_check = false;
return false;