FMU safety button: Latch to disabled state

As hardware buttons are not particularly reliable and the user flow is to disable safety then arm, then disarm via software / remote, it makes sense to make the button safety state itself sticky and require it to be reset via software.
This commit is contained in:
Lorenz Meier 2021-02-03 21:38:15 +01:00
parent 3f1ca4dfc9
commit 7157584fe1

View File

@ -84,7 +84,7 @@ SafetyButton::CheckButton()
_button_counter++;
} else if (_button_counter == CYCLE_COUNT) {
// switch to armed state
// switch safety off and to ok-to-arm state
_safety_btn_off = true;
_button_counter++;
}
@ -95,8 +95,9 @@ SafetyButton::CheckButton()
_button_counter++;
} else if (_button_counter == CYCLE_COUNT) {
// change to disarmed state and notify
_safety_btn_off = false;
// do not switch safety off,
// as a button that is stuck in hardware
// could cause this
_button_counter++;
}