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).
Moved to shared code and cms.c refactoring
Added missing line endings and comments
Passing tests - defines added
Added missing definition
Added check for USE_USB_CDC_HID in cmsUpdate
Code refactoring and condition change
Remove unnecessary include
Disable stick commands when HID is active and USB is connected
cdcDeviceIsMayBeActive refactored
Disable stick commands when HID is active and USB is connected
Previously stick arming was assumed to be the case if an arming switch was not configured. This leads to a less safe default state and can lead to beginners thinking that stick arming is the default.
This change adds an `enable_stick_arming` setting which defaults to `OFF`. For stick arming to function the user must actively change this setting. The previous condition about there not being an arming switch configured still applies.
Analyze the rc modes activation conditions and only process configured entries. Previously the entire possible list was processed even though typically only a handful are configured.
Reduces the RX task processing time by about 25% (~44us to ~33us) with an average setup of 3 modes configured (F405, SBUS). Processing time savings will diminish as the user configures more modes. But typically far fewer than the maximum of 20 will be configured.
Previously the initial arming attempt would initiate the gyro calibration but then fail because gyro calibration was underway. The user is confused as they're holding the arming sticks but nothing is happening. This always forced the user to release the arming stick command and then perform a second arming stick command to actually arm.
After the fix the initial arming will proceed as long as the pilot holds the arming stick command through the duration of the gyro calibration (1.25 seconds by default). This seems normal to the user as they're waiting for the motors to start (or at least the arming beeps) before releasing the sticks anyway.
Tries to prevent DSHOT beacon commands from interfering with commands to set the motor direction.
Adds a 2 second delay after disarming before DSHOT beacon commands will be sent. This attempts to prevent the beacon commands from interfering with the motor direction reset that happens after using crash flip mode.
During arming if a DSHOT beacon command has been sent within 2 seconds the arming will be delayed until the 2 seconds have passed. This attempts to prevent interference with the motor direction commands sent at arming.
* Fix for minthrottle when feature 3d and pwm enabled
* add parameters for min and max 3d output
* bug fix
* remove new parameters from msp
* remove new parameters again
* fixed indentation
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.
Detects runaway pidSum values on takeoff and auto-disarms to prevent the "Tasmanian Devil" caused by incorrect props, wrong motor order/direction, incorrect flight controller orientation, etc. After a successful takeoff and normal flight is detected the feature is disabled for the remainder of the battery.