summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2020-11-19 18:49:05 (GMT)
committerGitHub <noreply@github.com>2020-11-19 18:49:05 (GMT)
commitfa4c0d5e3e278b086362ca099b3ab781d37686f2 (patch)
tree35428f7a0d3a2a82ece743147fcb6147bc0bc6ea
parentf96e0b53d084044e01d084da2c74ed0f036677cd (diff)
parent3703611a6013f4f0905ab4f3de9f3157e73f52b5 (diff)
Merge pull request #125 from IoTPanic/patch-menubattery-iotpanic
Fixed battery percentage readout in the menu display
-rw-r--r--src/displayapp/screens/SystemInfo.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp
index 867fdae..83384fb 100644
--- a/src/displayapp/screens/SystemInfo.cpp
+++ b/src/displayapp/screens/SystemInfo.cpp
@@ -43,10 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
}
std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
- auto batteryPercentF = batteryController.PercentRemaining();
- uint16_t batteryPercent = 0;
- if(batteryPercentF > 100.0f) batteryPercent = 100;
- else if(batteryPercentF < 0.0f) batteryPercent = 0;
+ auto batteryPercent = static_cast<uint8_t>(batteryController.PercentRemaining());
uint8_t brightness = 0;
switch(brightnessController.Level()) {