FailureDetector: remove obsolete bit switch checks

This commit is contained in:
Matthias Grob
2020-07-30 16:19:43 +02:00
parent c9b81eaf08
commit f47bb95b26
@@ -177,16 +177,13 @@ void FailureDetector::updateEscsStatus(const vehicle_status_s &vehicle_status)
_esc_failure_hysteresis.set_hysteresis_time_from(false, 300_ms);
_esc_failure_hysteresis.set_state_and_update(all_escs_armed != esc_status.esc_armed_flags, time_now);
if (_esc_failure_hysteresis.get_state() && !(_status & FAILURE_ARM_ESCS)) {
if (_esc_failure_hysteresis.get_state()) {
_status |= FAILURE_ARM_ESCS;
}
} else {
// reset ESC bitfield
_esc_failure_hysteresis.set_state_and_update(false, time_now);
if (_status & FAILURE_ARM_ESCS) {
_status &= ~FAILURE_ARM_ESCS;
}
_status &= ~FAILURE_ARM_ESCS;
}
}