Fix to #119
This commit is contained in:
parent
0e97db1c30
commit
c816d9b88e
|
@ -43,10 +43,9 @@ 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 = batteryController.PercentRemaining();
|
||||||
uint16_t batteryPercent = 0;
|
if(batteryPercent > 100.0f) batteryPercent = 100;
|
||||||
if(batteryPercentF > 100.0f) batteryPercent = 100;
|
else if(batteryPercent < 0.0f) batteryPercent = 0;
|
||||||
else if(batteryPercentF < 0.0f) batteryPercent = 0;
|
|
||||||
|
|
||||||
uint8_t brightness = 0;
|
uint8_t brightness = 0;
|
||||||
switch(brightnessController.Level()) {
|
switch(brightnessController.Level()) {
|
||||||
|
@ -98,7 +97,7 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
|
||||||
dateTimeController.Day(), static_cast<uint8_t>(dateTimeController.Month()), dateTimeController.Year(),
|
dateTimeController.Day(), static_cast<uint8_t>(dateTimeController.Month()), dateTimeController.Year(),
|
||||||
dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(),
|
dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(),
|
||||||
uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds,
|
uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds,
|
||||||
batteryPercent, brightness, resetReason);
|
(int) batteryPercent, brightness, resetReason);
|
||||||
|
|
||||||
return std::unique_ptr<Screen>(new Screens::Label(app, t1));
|
return std::unique_ptr<Screen>(new Screens::Label(app, t1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue