From 76369d153f0ce741369a9678d40aee15ee38764f Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 9 Jul 2014 17:28:53 +0900 Subject: [PATCH] Arming: use compass.configured method This checks that when compass offset learning is off, that the offsets are non-zero and that the detected device id matches the device id stored to eeprom when the offsets were last saved. --- libraries/AP_Arming/AP_Arming.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index aaca72d823..23fecdd9c6 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -113,8 +113,7 @@ bool AP_Arming::compass_checks(bool report) return false; } // check compass learning is on or offsets have been set - Vector3f offsets = compass->get_offsets(); - if(!compass->_learn && offsets.length() == 0) { + if (!compass.learn_offsets_enabled() && !compass.configured()) { if (report) { gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Compass not calibrated")); }