From b930c800e4bb446d22feff9c9e2161157d7f1bf5 Mon Sep 17 00:00:00 2001 From: Will Silva Date: Tue, 13 Sep 2016 15:08:37 -0700 Subject: [PATCH] ekf_check: only use gps glitch mode reversion when ekf_failsafe attempts reversion --- ArduCopter/ekf_check.pde | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ArduCopter/ekf_check.pde b/ArduCopter/ekf_check.pde index e0a74c934a..a1d60f34eb 100644 --- a/ArduCopter/ekf_check.pde +++ b/ArduCopter/ekf_check.pde @@ -176,12 +176,14 @@ static void failsafe_ekf_off_event(void) Log_Write_Error(ERROR_SUBSYSTEM_FAILSAFE_EKFINAV, ERROR_CODE_FAILSAFE_RESOLVED); if (ekf_check_switch_mode_on_resolve) { - if (failsafe.gps_glitch) { - gps_glitch_switch_mode_on_resolve = true; - } else if (!mode_requires_RC(ekf_check_mode_before_fs_on)) { + if (!mode_requires_RC(ekf_check_mode_before_fs_on)) { set_mode_RTL_or_land_with_pause(); } else if (mode_requires_GPS(ekf_check_mode_before_fs_on)) { - set_mode(LOITER); + if (failsafe.gps_glitch) { + gps_glitch_switch_mode_on_resolve = true; + } else { + set_mode(LOITER); + } } } }