mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-14 03:50:02 +03:00
Add box mode to disable stick commands
Adds a `STICK COMMAND DISABLE SW` mode used to prevent inadvertant triggering of controls, calibrations, or settings changes. Useful for USB HID mode when using the flight controller as a joystick (and auto-detect doesn't work), in "team" or "relay" racing where multiple quads might be bound to the same transmitter, or just in general if the user wants prevent stick commands. Will also prevent stick arming when the mode is active (but not stick disarming).
This commit is contained in:
parent
de35df8e07
commit
19ece68555
5 changed files with 8 additions and 4 deletions
|
@ -205,7 +205,7 @@ void processRcStickPositions()
|
|||
}
|
||||
}
|
||||
return;
|
||||
} else if (rcSticks == THR_LO + YAW_HI + PIT_CE + ROL_CE) {
|
||||
} else if (rcSticks == THR_LO + YAW_HI + PIT_CE + ROL_CE && !IS_RC_MODE_ACTIVE(BOXSTICKCOMMANDDISABLE)) { // disable stick arming if STICK COMMAND DISABLE SW is active
|
||||
if (rcDelayMs >= ARM_DELAY_MS && !doNotRepeat) {
|
||||
doNotRepeat = true;
|
||||
if (!ARMING_FLAG(ARMED)) {
|
||||
|
@ -231,7 +231,7 @@ void processRcStickPositions()
|
|||
|
||||
#ifdef USE_USB_CDC_HID
|
||||
// If this target is used as a joystick, we should leave here.
|
||||
if (cdcDeviceIsMayBeActive()) {
|
||||
if (cdcDeviceIsMayBeActive() || IS_RC_MODE_ACTIVE(BOXSTICKCOMMANDDISABLE)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue