From 271ca78be55e2330b88bec90c7fe8f7a2e27bc87 Mon Sep 17 00:00:00 2001 From: panky-codes Date: Sat, 16 Jan 2021 20:18:55 +0100 Subject: [PATCH] Converted all the other float usage to int. --- src/components/battery/BatteryController.h | 2 +- src/displayapp/screens/BatteryIcon.cpp | 10 +++++----- src/displayapp/screens/BatteryIcon.h | 2 +- src/displayapp/screens/Clock.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index 0f2c2a42..2329f162 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -7,7 +7,7 @@ namespace Pinetime { namespace Controllers { // A simple circular buffer that can be used to average - // out sensor values + // out the sensor values template class CircBuffer { public: diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index 4c102477..455b0c6d 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -3,11 +3,11 @@ using namespace Pinetime::Applications::Screens; -const char* BatteryIcon::GetBatteryIcon(float batteryPercent) { - if(batteryPercent > 90.0f) return Symbols::batteryFull; - if(batteryPercent > 75.0f) return Symbols::batteryThreeQuarter; - if(batteryPercent > 50.0f) return Symbols::batteryHalf; - if(batteryPercent > 25.0f) return Symbols::batteryOneQuarter; +const char* BatteryIcon::GetBatteryIcon(int batteryPercent) { + if(batteryPercent > 90) return Symbols::batteryFull; + if(batteryPercent > 75) return Symbols::batteryThreeQuarter; + if(batteryPercent > 50) return Symbols::batteryHalf; + if(batteryPercent > 25) return Symbols::batteryOneQuarter; return Symbols::batteryEmpty; } diff --git a/src/displayapp/screens/BatteryIcon.h b/src/displayapp/screens/BatteryIcon.h index f1001923..006e5621 100644 --- a/src/displayapp/screens/BatteryIcon.h +++ b/src/displayapp/screens/BatteryIcon.h @@ -6,7 +6,7 @@ namespace Pinetime { class BatteryIcon { public: static const char* GetUnknownIcon(); - static const char* GetBatteryIcon(float batteryPercent); + static const char* GetBatteryIcon(int batteryPercent); static const char* GetPlugIcon(bool isCharging); }; } diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 4c5f60a0..c7f2d9db 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -62,7 +62,7 @@ namespace Pinetime { Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown; uint8_t currentDay = 0; - DirtyValue batteryPercentRemaining {0}; + DirtyValue batteryPercentRemaining {0}; DirtyValue bleState {false}; DirtyValue> currentDateTime; DirtyValue stepCount {0};