Merge pull request #125 from IoTPanic/patch-menubattery-iotpanic

Fixed battery percentage readout in the menu display
This commit is contained in:
JF002 2020-11-19 19:49:05 +01:00 committed by GitHub
commit fa4c0d5e3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -43,10 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
} }
std::unique_ptr<Screen> SystemInfo::CreateScreen1() { std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
auto batteryPercentF = batteryController.PercentRemaining(); auto batteryPercent = static_cast<uint8_t>(batteryController.PercentRemaining());
uint16_t batteryPercent = 0;
if(batteryPercentF > 100.0f) batteryPercent = 100;
else if(batteryPercentF < 0.0f) batteryPercent = 0;
uint8_t brightness = 0; uint8_t brightness = 0;
switch(brightnessController.Level()) { switch(brightnessController.Level()) {