Safety: keep initialized constant flags when safety disabled

This commit is contained in:
Matthias Grob 2022-06-07 18:21:56 +02:00 committed by Igor Mišić
parent 44c4b8fa85
commit 71103e6114
1 changed files with 6 additions and 6 deletions

View File

@ -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;
}