aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteve Amor <steveamor@users.noreply.github.com>2025-02-28 19:15:29 +0000
committermark9064 <30447455+mark9064@users.noreply.github.com>2025-05-23 17:46:14 +0100
commit9fb35cc073452d20a8c106693d86ffd332a85032 (patch)
treeb373dbbab6c83c7a1c08181a2d2896e97060530a /src
parent248a6aea8771389cf733e89090096258e936f3b2 (diff)
Refactors watch faces. Replace lv_tick_get() with xTaskGetTickCount()
Diffstat (limited to 'src')
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.cpp4
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.h2
-rw-r--r--src/displayapp/screens/WatchFacePineTimeStyle.cpp4
-rw-r--r--src/displayapp/screens/WatchFacePineTimeStyle.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp
index 40f2abbb..c7939711 100644
--- a/src/displayapp/screens/WatchFaceInfineat.cpp
+++ b/src/displayapp/screens/WatchFaceInfineat.cpp
@@ -316,7 +316,7 @@ WatchFaceInfineat::~WatchFaceInfineat() {
bool WatchFaceInfineat::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnSettings)) {
lv_obj_set_hidden(btnSettings, false);
- savedTick = lv_tick_get();
+ savedTick = xTaskGetTickCount();
return true;
}
// Prevent screen from sleeping when double tapping with settings on
@@ -463,7 +463,7 @@ void WatchFaceInfineat::Refresh() {
}
if (!lv_obj_get_hidden(btnSettings)) {
- if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
+ if ((savedTick > 0) && (xTaskGetTickCount() - savedTick > pdMS_TO_TICKS(3000))) {
lv_obj_set_hidden(btnSettings, true);
savedTick = 0;
}
diff --git a/src/displayapp/screens/WatchFaceInfineat.h b/src/displayapp/screens/WatchFaceInfineat.h
index 78d020f1..c8e11039 100644
--- a/src/displayapp/screens/WatchFaceInfineat.h
+++ b/src/displayapp/screens/WatchFaceInfineat.h
@@ -45,8 +45,8 @@ namespace Pinetime {
static bool IsAvailable(Pinetime::Controllers::FS& filesystem);
private:
- uint32_t savedTick = 0;
uint8_t chargingBatteryPercent = 101; // not a mistake ;)
+ TickType_t savedTick = 0;
TickType_t chargingAnimationTick = 0;
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
index 22ccefc7..ce8f8f7e 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.cpp
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp
@@ -407,7 +407,7 @@ bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents ev
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnClose)) {
lv_obj_set_hidden(btnSetColor, false);
lv_obj_set_hidden(btnSetOpts, false);
- savedTick = lv_tick_get();
+ savedTick = xTaskGetTickCount();
return true;
}
if ((event == Pinetime::Applications::TouchEvents::DoubleTap) && (lv_obj_get_hidden(btnClose) == false)) {
@@ -558,7 +558,7 @@ void WatchFacePineTimeStyle::Refresh() {
}
if (!lv_obj_get_hidden(btnSetColor)) {
- if ((savedTick > 0) && (lv_tick_get() - savedTick > 3000)) {
+ if ((savedTick > 0) && (xTaskGetTickCount() - savedTick > pdMS_TO_TICKS(3000))) {
lv_obj_set_hidden(btnSetColor, true);
lv_obj_set_hidden(btnSetOpts, true);
savedTick = 0;
diff --git a/src/displayapp/screens/WatchFacePineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h
index 72537095..e44a6128 100644
--- a/src/displayapp/screens/WatchFacePineTimeStyle.h
+++ b/src/displayapp/screens/WatchFacePineTimeStyle.h
@@ -52,7 +52,7 @@ namespace Pinetime {
Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
uint8_t currentDay = 0;
- uint32_t savedTick = 0;
+ TickType_t savedTick = 0;
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
Utility::DirtyValue<bool> isCharging {};