Use percentage instead of IsFull
This commit is contained in:
parent
ac2ccaeff6
commit
b31b2425f8
2 changed files with 1 additions and 5 deletions
|
@ -32,10 +32,6 @@ namespace Pinetime {
|
||||||
return isPowerPresent;
|
return isPowerPresent;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsFull() const {
|
|
||||||
return isFull;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static Battery* instance;
|
static Battery* instance;
|
||||||
nrf_saadc_value_t saadc_value;
|
nrf_saadc_value_t saadc_value;
|
||||||
|
|
|
@ -63,7 +63,7 @@ void BatteryInfo::Refresh() {
|
||||||
if (batteryController.IsCharging()) {
|
if (batteryController.IsCharging()) {
|
||||||
lv_obj_set_style_local_bg_color(charging_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_RED);
|
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");
|
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_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");
|
lv_label_set_text_static(status, "Fully charged");
|
||||||
} else if (batteryPercent < 10) {
|
} else if (batteryPercent < 10) {
|
||||||
|
|
Loading…
Reference in a new issue