Skip to content

Commit

Permalink
fix iterm bug introduced in PR13127 (betaflight#13201)
Browse files Browse the repository at this point in the history
fix iterm bug introduced in 13127
  • Loading branch information
ctzsnooze authored Dec 7, 2023
1 parent a88e894 commit b2ce402
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/fc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,15 @@ bool processRx(timeUs_t currentTimeUs)
const bool throttleActive = calculateThrottleStatus() != THROTTLE_LOW;
const uint8_t throttlePercent = calculateThrottlePercentAbs();
const bool launchControlActive = isLaunchControlActive();
airmodeIsActivated = airmodeIsEnabled() && ARMING_FLAG(ARMED) && throttlePercent >= rxConfig()->airModeActivateThreshold && !launchControlActive;

if (airmodeIsEnabled() && ARMING_FLAG(ARMED) && !launchControlActive) {
// once throttle exceeds activate threshold, airmode latches active until disarm
if (throttlePercent >= rxConfig()->airModeActivateThreshold) {
airmodeIsActivated = true;
}
} else {
airmodeIsActivated = false;
}

if (ARMING_FLAG(ARMED) && (airmodeIsActivated || throttleActive || launchControlActive || isFixedWing())) {
pidSetItermReset(false);
Expand Down

0 comments on commit b2ce402

Please sign in to comment.