From ef0b52e01715ea099227624dde49f5ebaf7688ee Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Thu, 19 Oct 2017 18:16:37 -0700 Subject: [PATCH] AP_Arming: Run extra GPS checks when arming --- libraries/AP_Arming/AP_Arming.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libraries/AP_Arming/AP_Arming.cpp b/libraries/AP_Arming/AP_Arming.cpp index 92f9288912..1fa87a6c95 100644 --- a/libraries/AP_Arming/AP_Arming.cpp +++ b/libraries/AP_Arming/AP_Arming.cpp @@ -509,6 +509,14 @@ bool AP_Arming::pre_arm_checks(bool report) bool AP_Arming::arm_checks(uint8_t method) { + // ensure the GPS drivers are ready on any final changes + if ((checks_to_perform & ARMING_CHECK_ALL) || + (checks_to_perform & ARMING_CHECK_GPS_CONFIG)) { + if (!AP_GPS::gps().prepare_for_arming()) { + return false; + } + } + // note that this will prepare DataFlash to start logging // so should be the last check to be done before arming if ((checks_to_perform & ARMING_CHECK_ALL) ||