From 904394a200d6b65aa60b7ef5cc8ae58e0d63f7d1 Mon Sep 17 00:00:00 2001 From: Klaus K Wilting Date: Mon, 20 Apr 2020 17:05:12 +0200 Subject: [PATCH] bugfix battery level status display IP5306 --- src/power.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/power.cpp b/src/power.cpp index 95608586..4506a6eb 100644 --- a/src/power.cpp +++ b/src/power.cpp @@ -303,13 +303,11 @@ uint8_t IP5306_GetBatteryLevel(void) { void printIP5306Stats(void) { bool usb = IP5306_GetPowerSource(); bool full = IP5306_GetBatteryFull(); - uint8_t leds = IP5306_GetBatteryLevel(); + uint8_t level = IP5306_GetBatteryLevel(); ESP_LOGI(TAG, - "IP5306: Power Source: %s, Battery State: %s, Battery " - "Level: %u%%", + "IP5306: Power Source: %s, Battery State: %s, Battery Level: %u%%", usb ? "USB" : "BATTERY", - full ? "CHARGED" : (usb ? "CHARGING" : "DISCHARGING"), - IP5306_LEDS2PCT(leds)); + full ? "CHARGED" : (usb ? "CHARGING" : "DISCHARGING"), level); } #endif // HAS_IP5306 \ No newline at end of file