Disable stick command processing while ARMING_DISABLED_RUNAWAY_TAKEOFF is set

Addresses the rare possibility that if runway takeoff triggers and disarms while the pilot has the sticks in some valid stick command configuration. Prevents the stick command from processing until the craft is disarmed and the ARMING_DISABLED_RUNAWAY_TAKEOFF condition is cleared.

For example, if the pilot was mid throttle and went full yaw right and runway takeoff triggered, then camera control would have be entered.
This commit is contained in:
Bruce Luckcuck 2018-02-24 09:08:23 -05:00
parent aec34a2b26
commit 2610344266
2 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,7 @@ void processRcStickPositions()
return; return;
} }
if (ARMING_FLAG(ARMED) || doNotRepeat || rcDelayMs <= STICK_DELAY_MS) { if (ARMING_FLAG(ARMED) || doNotRepeat || rcDelayMs <= STICK_DELAY_MS || (getArmingDisableFlags() & ARMING_DISABLED_RUNAWAY_TAKEOFF)) {
return; return;
} }
doNotRepeat = true; doNotRepeat = true;

View File

@ -730,3 +730,6 @@ PG_REGISTER(systemConfig_t, systemConfig, PG_SYSTEM_CONFIG, 2);
void resetArmingDisabled(void) {} void resetArmingDisabled(void) {}
timeDelta_t getTaskDeltaTime(cfTaskId_e) { return 20000; } timeDelta_t getTaskDeltaTime(cfTaskId_e) { return 20000; }
} }
armingDisableFlags_e getArmingDisableFlags(void) {
return (armingDisableFlags_e) 0;
}