mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
batteryCheck: fix enabling circuit breaker still causing battery failsafes
Failing checks caused failsafe flags to stay true when enabling the circuit breaker but not rebooting. Resetting the failsafe flags state when the circuit breaker is set resolves this issue.
This commit is contained in:
parent
3943025f32
commit
53d920ea33
@ -75,6 +75,10 @@ static constexpr const char *battery_fault_reason_str(battery_fault_reason_t bat
|
||||
void BatteryChecks::checkAndReport(const Context &context, Report &reporter)
|
||||
{
|
||||
if (circuit_breaker_enabled_by_val(_param_cbrk_supply_chk.get(), CBRK_SUPPLY_CHK_KEY)) {
|
||||
// Reset related failsafe flags otherwise failures from before disabling the check cause failsafes without reported reason
|
||||
reporter.failsafeFlags().battery_unhealthy = false;
|
||||
reporter.failsafeFlags().battery_low_remaining_time = false;
|
||||
reporter.failsafeFlags().battery_warning = battery_status_s::BATTERY_WARNING_NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user