From 84cb0b865dcc1a6aab2b238726c1ac3cecc06c8a Mon Sep 17 00:00:00 2001 From: Bruce Luckcuck Date: Mon, 12 Feb 2018 19:29:39 -0500 Subject: [PATCH] Disable runaway takeoff when crash-flip mode is active Prevents Runaway Takeoff Prevention from auto-disarming during crash-flip (turtle mode). Addresses an edge-case where runaway takeoff prevention might not yet have been deactivated due to a crash immediatly upon takeoff. --- src/main/fc/fc_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index 0b1d5101c9..34476e89db 100644 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -529,6 +529,7 @@ bool processRx(timeUs_t currentTimeUs) if (ARMING_FLAG(ARMED) && pidConfig()->runaway_takeoff_prevention && !runawayTakeoffCheckDisabled + && !flipOverAfterCrashMode && !STATE(FIXED_WING)) { // Determine if we're in "flight" @@ -765,6 +766,7 @@ static void subTaskPidController(timeUs_t currentTimeUs) && !STATE(FIXED_WING) && pidConfig()->runaway_takeoff_prevention && !runawayTakeoffCheckDisabled + && !flipOverAfterCrashMode && (!feature(FEATURE_MOTOR_STOP) || isAirmodeActive() || (calculateThrottleStatus() != THROTTLE_LOW))) { const float runawayTakeoffThreshold = pidConfig()->runaway_takeoff_threshold * 10.0f;