mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 19:40:31 +03:00
Improve GPS Rescue Pitch smoothing and disarming (#12343)
This commit is contained in:
parent
f0e7b21264
commit
e957f0dfa6
16 changed files with 255 additions and 193 deletions
|
@ -177,10 +177,16 @@ void processRcStickPositions(void)
|
|||
resetTryingToArm();
|
||||
// Disarming via ARM BOX
|
||||
resetArmingDisabled();
|
||||
const bool switchFailsafe = (failsafeIsActive() && (IS_RC_MODE_ACTIVE(BOXFAILSAFE) || IS_RC_MODE_ACTIVE(BOXGPSRESCUE)));
|
||||
if (ARMING_FLAG(ARMED) && (failsafeIsReceivingRxData() || switchFailsafe)) {
|
||||
const bool boxFailsafeSwitchIsOn = IS_RC_MODE_ACTIVE(BOXFAILSAFE);
|
||||
if (ARMING_FLAG(ARMED) && (failsafeIsReceivingRxData() || boxFailsafeSwitchIsOn)) {
|
||||
// in a true signal loss situation, allow disarm only once we regain validated RxData (failsafeIsReceivingRxData = true),
|
||||
// to avoid potentially false disarm signals soon after link recover
|
||||
// Note that BOXFAILSAFE will also drive failsafeIsReceivingRxData false (immediately at start or end)
|
||||
// That's why we explicitly allow disarm here BOXFAILSAFE switch is active
|
||||
// Note that BOXGPSRESCUE mode does not trigger failsafe - we can always disarm in that mode
|
||||
rcDisarmTicks++;
|
||||
if (rcDisarmTicks > 3) {
|
||||
// require three duplicate disarm values in a row before we disarm
|
||||
disarm(DISARM_REASON_SWITCH);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue