mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Require the arm switch to be off before arming
Requires that the arm switch must be moved from off to on after all arming disable flags are unset. Prevents accidental arming due to arm switch being left in the on position.
This commit is contained in:
parent
f283d2460a
commit
945870089f
3 changed files with 21 additions and 10 deletions
|
@ -182,11 +182,20 @@ void updateArmingStatus(void)
|
|||
unsetArmingDisabled(ARMING_DISABLED_CALIBRATING);
|
||||
}
|
||||
|
||||
if ((isModeActivationConditionPresent(BOXPREARM) && IS_RC_MODE_ACTIVE(BOXPREARM) && !ARMING_FLAG(WAS_ARMED_WITH_PREARM))
|
||||
if ((isModeActivationConditionPresent(BOXPREARM) && IS_RC_MODE_ACTIVE(BOXPREARM) && !ARMING_FLAG(WAS_ARMED_WITH_PREARM))
|
||||
|| !isModeActivationConditionPresent(BOXPREARM)) {
|
||||
unsetArmingDisabled(ARMING_DISABLED_NOPREARM);
|
||||
} else {
|
||||
setArmingDisabled(ARMING_DISABLED_NOPREARM);
|
||||
setArmingDisabled(ARMING_DISABLED_NOPREARM);
|
||||
}
|
||||
|
||||
if (!isUsingSticksForArming()) {
|
||||
// If arming is disabled and the ARM switch is on
|
||||
if (isArmingDisabled() && IS_RC_MODE_ACTIVE(BOXARM)) {
|
||||
setArmingDisabled(ARMING_DISABLED_ARM_SWITCH);
|
||||
} else if (!IS_RC_MODE_ACTIVE(BOXARM)) {
|
||||
unsetArmingDisabled(ARMING_DISABLED_ARM_SWITCH);
|
||||
}
|
||||
}
|
||||
|
||||
if (isArmingDisabled()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue