Copter: use prearm_failure_reason()

This commit is contained in:
Andrew Tridgell 2015-09-08 15:51:00 +10:00
parent 7e13edd4c7
commit dff9fe9cb2

View File

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