AP_Logger: Fix logging of current on non primary instances

This commit is contained in:
Michael du Breuil 2019-10-08 12:40:18 -07:00 committed by Andrew Tridgell
parent 752c2872f9
commit a9fabdb278
1 changed files with 1 additions and 1 deletions

View File

@ -643,7 +643,7 @@ void AP_Logger::Write_Current_instance(const uint64_t time_us,
float temp; float temp;
bool has_temp = battery.get_temperature(temp, battery_instance); bool has_temp = battery.get_temperature(temp, battery_instance);
float current, consumed_mah, consumed_wh; float current, consumed_mah, consumed_wh;
if (!battery.current_amps(current)) { if (!battery.current_amps(current, battery_instance)) {
current = quiet_nanf(); current = quiet_nanf();
} }
if (!battery.consumed_mah(consumed_mah, battery_instance)) { if (!battery.consumed_mah(consumed_mah, battery_instance)) {