1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

fix iterm bug introduced in PR13127 (#13201)

fix iterm bug introduced in 13127
This commit is contained in:
ctzsnooze 2023-12-08 05:55:01 +11:00 committed by GitHub
parent a88e8940aa
commit b2ce402635
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);