mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
FailureDetector: remove obsolete bit switch checks
This commit is contained in:
@@ -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_hysteresis_time_from(false, 300_ms);
|
||||||
_esc_failure_hysteresis.set_state_and_update(all_escs_armed != esc_status.esc_armed_flags, time_now);
|
_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;
|
_status |= FAILURE_ARM_ESCS;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// reset ESC bitfield
|
// reset ESC bitfield
|
||||||
_esc_failure_hysteresis.set_state_and_update(false, time_now);
|
_esc_failure_hysteresis.set_state_and_update(false, time_now);
|
||||||
|
_status &= ~FAILURE_ARM_ESCS;
|
||||||
if (_status & FAILURE_ARM_ESCS) {
|
|
||||||
_status &= ~FAILURE_ARM_ESCS;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user