1
0
Fork 0

Converted all the other float usage to int.

This commit is contained in:
panky-codes 2021-01-16 20:18:55 +01:00
parent e2d1f81915
commit 271ca78be5
4 changed files with 8 additions and 8 deletions

View file

@ -7,7 +7,7 @@
namespace Pinetime { namespace Pinetime {
namespace Controllers { namespace Controllers {
// A simple circular buffer that can be used to average // A simple circular buffer that can be used to average
// out sensor values // out the sensor values
template <int N> template <int N>
class CircBuffer { class CircBuffer {
public: public:

View file

@ -3,11 +3,11 @@
using namespace Pinetime::Applications::Screens; using namespace Pinetime::Applications::Screens;
const char* BatteryIcon::GetBatteryIcon(float batteryPercent) { const char* BatteryIcon::GetBatteryIcon(int batteryPercent) {
if(batteryPercent > 90.0f) return Symbols::batteryFull; if(batteryPercent > 90) return Symbols::batteryFull;
if(batteryPercent > 75.0f) return Symbols::batteryThreeQuarter; if(batteryPercent > 75) return Symbols::batteryThreeQuarter;
if(batteryPercent > 50.0f) return Symbols::batteryHalf; if(batteryPercent > 50) return Symbols::batteryHalf;
if(batteryPercent > 25.0f) return Symbols::batteryOneQuarter; if(batteryPercent > 25) return Symbols::batteryOneQuarter;
return Symbols::batteryEmpty; return Symbols::batteryEmpty;
} }

View file

@ -6,7 +6,7 @@ namespace Pinetime {
class BatteryIcon { class BatteryIcon {
public: public:
static const char* GetUnknownIcon(); static const char* GetUnknownIcon();
static const char* GetBatteryIcon(float batteryPercent); static const char* GetBatteryIcon(int batteryPercent);
static const char* GetPlugIcon(bool isCharging); static const char* GetPlugIcon(bool isCharging);
}; };
} }

View file

@ -62,7 +62,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<float> batteryPercentRemaining {0}; DirtyValue<int> 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};