From d977ca091a77b47e23e93c171993cd4b6edd017b Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Thu, 21 Jun 2018 18:07:34 -0700 Subject: [PATCH] AP_Arming: Correct an edge case that would not run compass checks --- libraries/AP_Arming/AP_Arming.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 30d93c1515..ab017aa66a 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -314,7 +314,9 @@ bool AP_Arming::compass_checks(bool report) if ((checks_to_perform) & ARMING_CHECK_ALL || (checks_to_perform) & ARMING_CHECK_COMPASS) { - if (!_compass.use_for_yaw()) { + // avoid Compass::use_for_yaw(void) as it implicitly calls healthy() which can + // incorrectly skip the remaining checks, pass the primary instance directly + if (!_compass.use_for_yaw(_compass.get_primary())) { // compass use is disabled return true; }