mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 16:25:31 +03:00
Fix so airmode threshold works
This commit is contained in:
parent
aeb9399722
commit
374dd3f327
2 changed files with 2 additions and 2 deletions
|
@ -392,7 +392,7 @@ void processRx(timeUs_t currentTimeUs)
|
||||||
const throttleStatus_e throttleStatus = calculateThrottleStatus();
|
const throttleStatus_e throttleStatus = calculateThrottleStatus();
|
||||||
|
|
||||||
if (isAirmodeActive() && ARMING_FLAG(ARMED)) {
|
if (isAirmodeActive() && ARMING_FLAG(ARMED)) {
|
||||||
if (rcCommand[THROTTLE] >= rxConfig()->airModeActivateThreshold) airmodeIsActivated = true; // Prevent Iterm from being reset
|
if (rcData[THROTTLE] >= rxConfig()->airModeActivateThreshold) airmodeIsActivated = true; // Prevent Iterm from being reset
|
||||||
} else {
|
} else {
|
||||||
airmodeIsActivated = false;
|
airmodeIsActivated = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,7 +332,7 @@ void updateRcCommands(void)
|
||||||
if (IS_RC_MODE_ACTIVE(BOX3DONASWITCH)) {
|
if (IS_RC_MODE_ACTIVE(BOX3DONASWITCH)) {
|
||||||
reverseMotors = true;
|
reverseMotors = true;
|
||||||
fix12_t throttleScaler = qConstruct(rcCommand[THROTTLE] - 1000, 1000);
|
fix12_t throttleScaler = qConstruct(rcCommand[THROTTLE] - 1000, 1000);
|
||||||
rcCommand[THROTTLE] = rxConfig()->midrc - qMultiply(throttleScaler, PWM_RANGE_MAX - rxConfig()->midrc);
|
rcCommand[THROTTLE] = rxConfig()->midrc + qMultiply(throttleScaler, PWM_RANGE_MIN - rxConfig()->midrc);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reverseMotors = false;
|
reverseMotors = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue