forked from Archive/PX4-Autopilot
Safety: keep initialized constant flags when safety disabled
This commit is contained in:
parent
44c4b8fa85
commit
71103e6114
|
@ -44,16 +44,16 @@ Safety::Safety()
|
|||
{
|
||||
// Safety can be turned off with the CBRK_IO_SAFETY parameter.
|
||||
_safety_disabled = circuit_breaker_enabled("CBRK_IO_SAFETY", CBRK_IO_SAFETY_KEY);
|
||||
|
||||
if (_safety_disabled) {
|
||||
_button_available = true;
|
||||
_safety_off = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Safety::safetyButtonHandler()
|
||||
{
|
||||
if (_safety_disabled) {
|
||||
_button_available = true;
|
||||
_safety_off = true;
|
||||
|
||||
} else {
|
||||
|
||||
if (!_safety_disabled) {
|
||||
if (!_button_available && _safety_button_sub.advertised()) {
|
||||
_button_available = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue