From facc0ea8bb7e384169ea05310571db7328daa21c Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 11 Aug 2020 14:04:42 +0900 Subject: [PATCH] Sub: integrate ahrs.pre_arm_check --- ArduSub/AP_Arming_Sub.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ArduSub/AP_Arming_Sub.cpp b/ArduSub/AP_Arming_Sub.cpp index 197cab95b9..7b4a4e3399 100644 --- a/ArduSub/AP_Arming_Sub.cpp +++ b/ArduSub/AP_Arming_Sub.cpp @@ -65,12 +65,9 @@ bool AP_Arming_Sub::ins_checks(bool display_failure) // additional sub-specific checks if ((checks_to_perform & ARMING_CHECK_ALL) || (checks_to_perform & ARMING_CHECK_INS)) { - if (!AP::ahrs().prearm_healthy()) { - const char *reason = AP::ahrs().prearm_failure_reason(); - if (reason == nullptr) { - reason = "AHRS not healthy"; - } - check_failed(ARMING_CHECK_INS, display_failure, "%s", reason); + char failure_msg[50] = {}; + if (!AP::ahrs().pre_arm_check(failure_msg, sizeof(failure_msg))) { + check_failed(ARMING_CHECK_INS, display_failure, "AHRS: %s", failure_msg); return false; } }