File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ void Battery::SaadcEventHandler(nrfx_saadc_evt_t const* p_event) {
7474 } else if (voltage < battery_min) {
7575 percentRemaining = 0 ;
7676 } else {
77- percentRemaining = std::min ((voltage - battery_min) * 100 / (battery_max - battery_min), 99 );
77+ percentRemaining = std::min ((voltage - battery_min) * 100 / (battery_max - battery_min), isCharging ? 99 : 100 );
7878 }
7979
8080 nrfx_saadc_uninit ();
Original file line number Diff line number Diff line change @@ -102,9 +102,9 @@ WatchFaceDigital::~WatchFaceDigital() {
102102}
103103
104104void WatchFaceDigital::Refresh () {
105- isCharging = batteryController.IsCharging ();
106- if (isCharging .IsUpdated ()) {
107- lv_label_set_text (batteryPlug, BatteryIcon::GetPlugIcon (isCharging .Get ()));
105+ powerPresent = batteryController.IsPowerPresent ();
106+ if (powerPresent .IsUpdated ()) {
107+ lv_label_set_text (batteryPlug, BatteryIcon::GetPlugIcon (powerPresent .Get ()));
108108 }
109109
110110 batteryPercentRemaining = batteryController.PercentRemaining ();
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ namespace Pinetime {
4444 uint8_t currentDay = 0 ;
4545
4646 DirtyValue<uint8_t > batteryPercentRemaining {};
47- DirtyValue<bool > isCharging {};
47+ DirtyValue<bool > powerPresent {};
4848 DirtyValue<bool > bleState {};
4949 DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
5050 DirtyValue<bool > motionSensorOk {};
You can’t perform that action at this time.
0 commit comments