From 600dbb0280aae3cc45f7256ac845780663eaf7f8 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 16 Nov 2020 09:43:32 -0500 Subject: Fix for comments on issue #125, bounds check removed --- src/displayapp/screens/SystemInfo.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/displayapp') diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 34359c2c..81704303 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -43,9 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr SystemInfo::CreateScreen1() { - auto batteryPercent = batteryController.PercentRemaining(); - if(batteryPercent > 100.0f) batteryPercent = 100; - else if(batteryPercent < 0.0f) batteryPercent = 0; + int8_t batteryPercent = (int)batteryController.PercentRemaining(); uint8_t brightness = 0; switch(brightnessController.Level()) { -- cgit v1.2.3