mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Merge pull request #3854 from DanNixon/simplify_prearm_check_confition
Simplify boolean expression for prearm state test
This commit is contained in:
commit
391d9afe94
1 changed files with 6 additions and 5 deletions
|
@ -206,12 +206,13 @@ void updateArmingStatus(void)
|
||||||
unsetArmingDisabled(ARMING_DISABLED_CALIBRATING);
|
unsetArmingDisabled(ARMING_DISABLED_CALIBRATING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((isModeActivationConditionPresent(BOXPREARM) && IS_RC_MODE_ACTIVE(BOXPREARM) && !ARMING_FLAG(WAS_ARMED_WITH_PREARM))
|
if (isModeActivationConditionPresent(BOXPREARM)) {
|
||||||
|| !isModeActivationConditionPresent(BOXPREARM)) {
|
if (IS_RC_MODE_ACTIVE(BOXPREARM) && !ARMING_FLAG(WAS_ARMED_WITH_PREARM)) {
|
||||||
unsetArmingDisabled(ARMING_DISABLED_NOPREARM);
|
unsetArmingDisabled(ARMING_DISABLED_NOPREARM);
|
||||||
} else {
|
} else {
|
||||||
setArmingDisabled(ARMING_DISABLED_NOPREARM);
|
setArmingDisabled(ARMING_DISABLED_NOPREARM);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!isUsingSticksForArming()) {
|
if (!isUsingSticksForArming()) {
|
||||||
// If arming is disabled and the ARM switch is on
|
// If arming is disabled and the ARM switch is on
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue