From 4636f10385424b81426f504aa3a1e1c54739d779 Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Wed, 24 Oct 2018 10:58:50 -0400 Subject: [PATCH] Prevent MOTOR_STOP auto-disarm for stick arming when GPS Rescue is active The MOTOR_STOP logic is designed to stop the motors if: 1. MOTOR_STOP feature is enabled 2. Airmode is disabled 3. Throttle is at minimum The problem is that this also applied during GPS Rescue and if the pilot had these conditions the motors would stop. Changed to disable MOTOR_STOP while GPS Rescue is active. Also if stick-arming is used the MOTOR_STOP logic also will auto-disarm after 5 seconds (auto_disarm_delay). Disable this also when GPS Rescue is active. --- src/main/fc/core.c | 1 + src/main/flight/mixer.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/fc/core.c b/src/main/fc/core.c index 31400a7a74..8ff491b2f1 100644 --- a/src/main/fc/core.c +++ b/src/main/fc/core.c @@ -675,6 +675,7 @@ bool processRx(timeUs_t currentTimeUs) && !STATE(FIXED_WING) && !featureIsEnabled(FEATURE_3D) && !airmodeIsEnabled() + && !FLIGHT_MODE(GPS_RESCUE_MODE) // disable auto-disarm when GPS Rescue is active ) { if (isUsingSticksForArming()) { if (throttleStatus == THROTTLE_LOW) { diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index e02fc2c774..e93f8f2414 100644 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -851,6 +851,7 @@ FAST_CODE_NOINLINE void mixTable(timeUs_t currentTimeUs, uint8_t vbatPidCompensa && ARMING_FLAG(ARMED) && !featureIsEnabled(FEATURE_3D) && !airmodeEnabled + && !FLIGHT_MODE(GPS_RESCUE_MODE) // disable motor_stop while GPS Rescue is active && (rcData[THROTTLE] < rxConfig()->mincheck)) { // motor_stop handling applyMotorStop();