From 05d104675eebcdc28720bd9ed9d21b52bf17d9dd Mon Sep 17 00:00:00 2001 From: Michael du Breuil Date: Tue, 8 Oct 2019 12:40:18 -0700 Subject: [PATCH] AP_Logger: Fix logging of current on non primary instances --- libraries/AP_Logger/LogFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Logger/LogFile.cpp b/libraries/AP_Logger/LogFile.cpp index cce06e6d00..67ed96a91d 100644 --- a/libraries/AP_Logger/LogFile.cpp +++ b/libraries/AP_Logger/LogFile.cpp @@ -643,7 +643,7 @@ void AP_Logger::Write_Current_instance(const uint64_t time_us, float temp; bool has_temp = battery.get_temperature(temp, battery_instance); float current, consumed_mah, consumed_wh; - if (!battery.current_amps(current)) { + if (!battery.current_amps(current, battery_instance)) { current = quiet_nanf(); } if (!battery.consumed_mah(consumed_mah, battery_instance)) {