mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Fix failsafe_throttle
being ignored if it was less than min_check
when MOTOR_STOP was enabled.
This commit is contained in:
parent
53eec05809
commit
cc5c736362
1 changed files with 4 additions and 1 deletions
|
@ -44,6 +44,7 @@
|
||||||
#include "sensors/acceleration.h"
|
#include "sensors/acceleration.h"
|
||||||
|
|
||||||
#include "flight/mixer.h"
|
#include "flight/mixer.h"
|
||||||
|
#include "flight/failsafe.h"
|
||||||
#include "flight/pid.h"
|
#include "flight/pid.h"
|
||||||
#include "flight/imu.h"
|
#include "flight/imu.h"
|
||||||
#include "flight/lowpass.h"
|
#include "flight/lowpass.h"
|
||||||
|
@ -677,6 +678,8 @@ void mixTable(void)
|
||||||
|
|
||||||
if (ARMING_FLAG(ARMED)) {
|
if (ARMING_FLAG(ARMED)) {
|
||||||
|
|
||||||
|
bool isFailsafeActive = failsafeIsActive();
|
||||||
|
|
||||||
// Find the maximum motor output.
|
// Find the maximum motor output.
|
||||||
int16_t maxMotor = motor[0];
|
int16_t maxMotor = motor[0];
|
||||||
for (i = 1; i < motorCount; i++) {
|
for (i = 1; i < motorCount; i++) {
|
||||||
|
@ -704,7 +707,7 @@ void mixTable(void)
|
||||||
// If we're at minimum throttle and FEATURE_MOTOR_STOP enabled,
|
// If we're at minimum throttle and FEATURE_MOTOR_STOP enabled,
|
||||||
// do not spin the motors.
|
// do not spin the motors.
|
||||||
motor[i] = constrain(motor[i], escAndServoConfig->minthrottle, escAndServoConfig->maxthrottle);
|
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)) {
|
if (feature(FEATURE_MOTOR_STOP)) {
|
||||||
motor[i] = escAndServoConfig->mincommand;
|
motor[i] = escAndServoConfig->mincommand;
|
||||||
} else if (mixerConfig->pid_at_min_throttle == 0) {
|
} else if (mixerConfig->pid_at_min_throttle == 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue