AP_BattMonitor: Keep mavlink_charge_state instanced

Currently the method will report unhealthy in
BATTERY_STATUS.charge_state for ALL batteries, if one battery is
unhealthy.

Fix it to refer to the current instance only.
This commit is contained in:
George Zogopoulos
2026-08-18 10:25:18 +10:00
committed by Peter Barker
parent 08a9972abb
commit 2343472f50
+1 -1
View File
@@ -1202,7 +1202,7 @@ MAV_BATTERY_CHARGE_STATE AP_BattMonitor::get_mavlink_charge_state(const uint8_t
case Failsafe::None:
case Failsafe::Unhealthy:
if (get_mavlink_fault_bitmask(instance) != 0 || !healthy()) {
if (get_mavlink_fault_bitmask(instance) != 0 || !healthy(instance)) {
return MAV_BATTERY_CHARGE_STATE_UNHEALTHY;
}
return MAV_BATTERY_CHARGE_STATE_OK;