From b31b2425f8afd5022173852f5a78592b37104c39 Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Fri, 3 Sep 2021 16:57:00 +0300 Subject: [PATCH] Use percentage instead of IsFull --- src/components/battery/BatteryController.h | 4 ---- src/displayapp/screens/BatteryInfo.cpp | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index 164057c4..b66da5e4 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -32,10 +32,6 @@ namespace Pinetime { return isPowerPresent; } - bool IsFull() const { - return isFull; - } - private: static Battery* instance; nrf_saadc_value_t saadc_value; diff --git a/src/displayapp/screens/BatteryInfo.cpp b/src/displayapp/screens/BatteryInfo.cpp index 4dcf29c5..25fd1efa 100644 --- a/src/displayapp/screens/BatteryInfo.cpp +++ b/src/displayapp/screens/BatteryInfo.cpp @@ -63,7 +63,7 @@ void BatteryInfo::Refresh() { if (batteryController.IsCharging()) { lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED); lv_label_set_text_static(status, "Charging"); - } else if (batteryController.IsFull()) { + } else if (batteryPercent == 100) { lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_BLUE); lv_label_set_text_static(status, "Fully charged"); } else if (batteryPercent < 10) {