Skip to content

Commit 271ca78

Browse files
author
panky-codes
committed
Converted all the other float usage to int.
1 parent e2d1f81 commit 271ca78

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/components/battery/BatteryController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Pinetime {
88
namespace Controllers {
99
// A simple circular buffer that can be used to average
10-
// out sensor values
10+
// out the sensor values
1111
template <int N>
1212
class CircBuffer {
1313
public:

src/displayapp/screens/BatteryIcon.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
using namespace Pinetime::Applications::Screens;
55

6-
const char* BatteryIcon::GetBatteryIcon(float batteryPercent) {
7-
if(batteryPercent > 90.0f) return Symbols::batteryFull;
8-
if(batteryPercent > 75.0f) return Symbols::batteryThreeQuarter;
9-
if(batteryPercent > 50.0f) return Symbols::batteryHalf;
10-
if(batteryPercent > 25.0f) return Symbols::batteryOneQuarter;
6+
const char* BatteryIcon::GetBatteryIcon(int batteryPercent) {
7+
if(batteryPercent > 90) return Symbols::batteryFull;
8+
if(batteryPercent > 75) return Symbols::batteryThreeQuarter;
9+
if(batteryPercent > 50) return Symbols::batteryHalf;
10+
if(batteryPercent > 25) return Symbols::batteryOneQuarter;
1111
return Symbols::batteryEmpty;
1212
}
1313

src/displayapp/screens/BatteryIcon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Pinetime {
66
class BatteryIcon {
77
public:
88
static const char* GetUnknownIcon();
9-
static const char* GetBatteryIcon(float batteryPercent);
9+
static const char* GetBatteryIcon(int batteryPercent);
1010
static const char* GetPlugIcon(bool isCharging);
1111
};
1212
}

src/displayapp/screens/Clock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ namespace Pinetime {
6262
Pinetime::Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
6363
uint8_t currentDay = 0;
6464

65-
DirtyValue<float> batteryPercentRemaining {0};
65+
DirtyValue<int> batteryPercentRemaining {0};
6666
DirtyValue<bool> bleState {false};
6767
DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime;
6868
DirtyValue<uint32_t> stepCount {0};

0 commit comments

Comments
 (0)