From def4a0ad85a3e58501c19863de1f245a2b254ef4 Mon Sep 17 00:00:00 2001 From: Ray Morris Date: Sat, 17 Oct 2026 23:19:28 -0500 Subject: [PATCH] Don't let logic condition arming override defeat failsafe DROP disarm OVERRIDE_ARMING_SAFETY bypassed every arming-disabled flag in tryArm(), including ARMING_DISABLED_FAILSAFE_SYSTEM. After failsafe DROP disarmed, the craft re-armed ~0.1 s later and the motors stayed at their last value. The override no longer applies while the failsafe lockout is set. --- docs/Programming Framework.md | 2 +- src/main/fc/fc_core.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Programming Framework.md b/docs/Programming Framework.md index 89e3cdf2e1c..f0d5db54633 100644 --- a/docs/Programming Framework.md +++ b/docs/Programming Framework.md @@ -84,7 +84,7 @@ for complete documentation on using JavaScript to program your flight controller | 19 | Increase GVAR | Increase the GVAR indexed by `Operand A` (use `Value 1` for Global Variable 1) with value from `Operand B` | | 20 | Decrease GVAR | Decrease the GVAR indexed by `Operand A` (use `Value 1` for Global Variable 1) with value from `Operand B` | | 21 | Set IO Port | Set I2C IO Expander pin `Operand A` to value of `Operand B`. `Operand A` accepts values `0-7` and `Operand B` accepts `0` and `1` | -| 22 | Override Arming Safety | Allows the craft to arm on any angle even without GPS fix. WARNING: This bypasses all safety checks, even that the throttle is low, so use with caution. If you only want to check for certain conditions, such as arm without GPS fix. You will need to add logic conditions to check the throttle is low. | +| 22 | Override Arming Safety | Allows the craft to arm on any angle even without GPS fix. WARNING: This bypasses all safety checks, even that the throttle is low, so use with caution. If you only want to check for certain conditions, such as arm without GPS fix. You will need to add logic conditions to check the throttle is low. It does not override the failsafe arming lockout that follows a failsafe disarm. | | 23 | Override Throttle Scale | Override throttle scale to the value defined by operand. Operand type `0` and value `50` means throttle will be scaled by 50%. | | 24 | Swap Roll & Yaw | basically, when activated, yaw stick will control roll and roll stick will control yaw. Required for tail-sitters VTOL during vertical-horizonral transition when body frame changes | | 25 | Set VTx Power Level | Sets VTX power level. Accepted values are `0-3` for SmartAudio and `0-4` for Tramp protocol | diff --git a/src/main/fc/fc_core.c b/src/main/fc/fc_core.c index 0b0a20a729f..69b60a85feb 100644 --- a/src/main/fc/fc_core.c +++ b/src/main/fc/fc_core.c @@ -617,7 +617,9 @@ void tryArm(void) #ifdef USE_PROGRAMMING_FRAMEWORK if (emergInflightRearmEnabled() || !isArmingDisabled() || emergencyArmingIsEnabled() || - LOGIC_CONDITION_GLOBAL_FLAG(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_ARMING_SAFETY)) { + // The failsafe lockout must survive the override, or it re-arms right after a failsafe disarm + (LOGIC_CONDITION_GLOBAL_FLAG(LOGIC_CONDITION_GLOBAL_FLAG_OVERRIDE_ARMING_SAFETY) && + !ARMING_FLAG(ARMING_DISABLED_FAILSAFE_SYSTEM))) { #else if (emergInflightRearmEnabled() || !isArmingDisabled() || emergencyArmingIsEnabled()) { #endif