Fix bad formatting in SystemInfo.

This commit is contained in:
JF 2020-08-22 20:43:14 +02:00
parent f7e40b1b58
commit 754918fda6
2 changed files with 6 additions and 5 deletions

View file

@ -57,7 +57,7 @@ namespace Pinetime {
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
uint8_t currentDay = 0; uint8_t currentDay = 0;
DirtyValue<uint8_t> batteryPercentRemaining {0}; DirtyValue<float> batteryPercentRemaining {0};
DirtyValue<bool> bleState {false}; DirtyValue<bool> bleState {false};
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime; DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
DirtyValue<uint32_t> stepCount {0}; DirtyValue<uint32_t> stepCount {0};

View file

@ -43,9 +43,10 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
} }
std::unique_ptr<Screen> SystemInfo::CreateScreen1() { std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
auto batteryPercent = static_cast<int16_t>(batteryController.PercentRemaining()); auto batteryPercentF = batteryController.PercentRemaining();
if(batteryPercent > 100) batteryPercent = 100; uint16_t batteryPercent = 0;
else if(batteryPercent < 0) 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()) {
@ -86,7 +87,7 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
"Version:%ld.%ld.%ld\n" "Version:%ld.%ld.%ld\n"
"Build: %s\n" "Build: %s\n"
" %s\n" " %s\n"
"Date: %02d/%02hhu/%04d\n" "Date: %02d/%02d/%04d\n"
"Time: %02d:%02d:%02d\n" "Time: %02d:%02d:%02d\n"
"Uptime: %02lud %02lu:%02lu:%02lu\n" "Uptime: %02lud %02lu:%02lu:%02lu\n"
"Battery: %d%%\n" "Battery: %d%%\n"