inav
inav copied to clipboard
Failsafe arm change of state protection
Resolves https://github.com/iNavFlight/inav/issues/6859
Adds a delay time setting when arming to allow a blocker to be applied to prevent inadvertent arming caused by the switched arming channel changing arm state during failsafe.
Also changes the blocker already used to prevent inadvertent disarming during failsafe. It's now based on the same method used to flag failsafe rather than just one of the means used to flag an invalid receiver signal.
Tested on a Flysky radio and works as intended but only if the delay for arm and disarm is increased to 300ms from the default of 250ms. Without the disarm blocker change the Flysky radio disarms on failsafe regardless of the disarm time delay. This does depend on the way the Arm mode is set up but you can only avoid a disarm at the expense of unwanted rearm and visa versa.
This issue / pull request has been automatically marked as stale because it has not had any activity in 60 days. The resources of the INAV team are limited, and so we are asking for your help. This issue / pull request will be closed if no further activity occurs within two weeks.
Automatically closing as inactive.
Reopening in relation to https://github.com/iNavFlight/inav/discussions/8093.
PR has been updated to remove the dependence on IS_RC_MODE_ACTIVE(BOXFAILSAFE) since it doesn't seem relevant here. However, the main reason for reopening is related to the fact that rxIsReceivingSignal() doesn't block disarm if the signal is received but is invalid potentially causing the arming channel to change value and disarm before failsafe kicks in.
The PR also includes another time delay on arming to avoid unwanted rearming which was in fact the main reason for the PR in the first place but this perhaps isn't such an issue now with newer receivers so could be removed.