bugfix battery level status display IP5306

This commit is contained in:
Klaus K Wilting 2020-04-20 17:05:12 +02:00
parent 2624f7b35b
commit 904394a200

View File

@ -303,13 +303,11 @@ uint8_t IP5306_GetBatteryLevel(void) {
void printIP5306Stats(void) { void printIP5306Stats(void) {
bool usb = IP5306_GetPowerSource(); bool usb = IP5306_GetPowerSource();
bool full = IP5306_GetBatteryFull(); bool full = IP5306_GetBatteryFull();
uint8_t leds = IP5306_GetBatteryLevel(); uint8_t level = IP5306_GetBatteryLevel();
ESP_LOGI(TAG, ESP_LOGI(TAG,
"IP5306: Power Source: %s, Battery State: %s, Battery " "IP5306: Power Source: %s, Battery State: %s, Battery Level: %u%%",
"Level: %u%%",
usb ? "USB" : "BATTERY", usb ? "USB" : "BATTERY",
full ? "CHARGED" : (usb ? "CHARGING" : "DISCHARGING"), full ? "CHARGED" : (usb ? "CHARGING" : "DISCHARGING"), level);
IP5306_LEDS2PCT(leds));
} }
#endif // HAS_IP5306 #endif // HAS_IP5306