mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-02 05:04:08 +08:00
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:
parent
3f1ca4dfc9
commit
7157584fe1
@ -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++;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user