From de86342e9371364e39037dcdf766e8c1b7a775ab Mon Sep 17 00:00:00 2001 From: Siddharth Purohit Date: Wed, 20 Nov 2019 13:07:39 +0800 Subject: [PATCH] AP_Arming: add arming message for compass not detected but assigned --- libraries/AP_Arming/AP_Arming.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 578571cb34..58c04ec6f1 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -396,9 +396,12 @@ bool AP_Arming::compass_checks(bool report) return false; } // check compass learning is on or offsets have been set - if (!_compass.learn_offsets_enabled() && !_compass.configured()) { - check_failed(ARMING_CHECK_COMPASS, report, "Compass not calibrated"); - return false; + if (!_compass.learn_offsets_enabled()) { + char failure_msg[50] = {}; + if (!_compass.configured(failure_msg, ARRAY_SIZE(failure_msg))) { + check_failed(ARMING_CHECK_COMPASS, report, "%s", failure_msg); + return false; + } } // check for unreasonable compass offsets