mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-22 22:32:11 +08:00
Commander: ensure diconnected battery is cleared from bit field
This commit is contained in:
committed by
Daniel Agar
parent
113982e3e7
commit
b3776134b8
@@ -3868,11 +3868,16 @@ void Commander::battery_status_check()
|
||||
}
|
||||
}
|
||||
|
||||
_last_battery_mode[index] = battery.mode;
|
||||
|
||||
if (battery.connected) {
|
||||
_last_connected_batteries |= 1 << index;
|
||||
|
||||
} else {
|
||||
_last_connected_batteries &= ~(1 << index);
|
||||
}
|
||||
|
||||
_last_battery_mode[index] = battery.mode;
|
||||
|
||||
if (battery.connected) {
|
||||
if (battery.warning > worst_warning) {
|
||||
worst_warning = battery.warning;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user