Add "prearm was reset" flag to prevent rearming without resetting prearm & add prearm timeout #6737
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #6730. Alternative to #6731.
This fixes an oversight in my implementation of Prearm: Once prearm is held, you can toggle the arm switch on and off all day. So if a non-momentary prearm is used and the quad is disarmed without resetting the prearm, it can be armed again with the single arm switch, which defeats the prearm.
This PR adds a simple flag to track whether the prearm has been reset (not engaged / RC mode not active) since the last disarm.
This also adds an optional setting called
prearm_timeoutthat invalidates the prearm activation after a set duration. This means that you have to arm within a certain time window after pressing prearm, or the craft won't arm. This is a configurable value between 0 and 10 seconds. Setting it to 0 disables the timeout.