From cc5c736362793aaa124442275a7b7b6078d75433 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Tue, 19 May 2015 21:16:24 +0100 Subject: [PATCH] Fix `failsafe_throttle` being ignored if it was less than `min_check` when MOTOR_STOP was enabled. --- src/main/flight/mixer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/flight/mixer.c b/src/main/flight/mixer.c index 55ae12cab1..8081719a08 100755 --- a/src/main/flight/mixer.c +++ b/src/main/flight/mixer.c @@ -44,6 +44,7 @@ #include "sensors/acceleration.h" #include "flight/mixer.h" +#include "flight/failsafe.h" #include "flight/pid.h" #include "flight/imu.h" #include "flight/lowpass.h" @@ -677,6 +678,8 @@ void mixTable(void) if (ARMING_FLAG(ARMED)) { + bool isFailsafeActive = failsafeIsActive(); + // Find the maximum motor output. int16_t maxMotor = motor[0]; for (i = 1; i < motorCount; i++) { @@ -704,7 +707,7 @@ void mixTable(void) // If we're at minimum throttle and FEATURE_MOTOR_STOP enabled, // do not spin the motors. motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, escAndServoConfig->maxthrottle); - if ((rcData[THROTTLE]) < rxConfig->mincheck) { + if ((rcData[THROTTLE]) < rxConfig->mincheck && !isFailsafeActive) { if (feature(FEATURE_MOTOR_STOP)) { motor[i] = escAndServoConfig->mincommand; } else if (mixerConfig->pid_at_min_throttle == 0) {