mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
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:
committed by
Peter Barker
parent
08a9972abb
commit
2343472f50
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user