Skip to content

Commit fb2e3a9

Browse files
committed
update tick type
1 parent 2d0c787 commit fb2e3a9

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/displayapp/screens/WatchFaceCasioStyleAE21W.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ namespace {
258258
bool WatchFaceCasioStyleAE21W::OnTouchEvent(Pinetime::Applications::TouchEvents event) {
259259
if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnSettings)) {
260260
lv_obj_set_hidden(btnSettings, false);
261-
savedTick = lv_tick_get();
261+
savedTick = xTaskGetTickCount();
262262
return true;
263263
}
264264
// Prevent screen from sleeping when double tapping with settings on
@@ -289,9 +289,9 @@ void WatchFaceCasioStyleAE21W::UpdateSelected(lv_obj_t* object, lv_event_t event
289289
}
290290

291291
// avoid clicking too quickly
292-
static uint32_t lastClick = 0;
293-
uint32_t currentTick = lv_tick_get();
294-
if (currentTick - lastClick < 200) { // 200ms
292+
static TickType_t lastClick = 0;
293+
TickType_t currentTick = lv_tick_get();
294+
if ((currentTick - lastClick) < pdMS_TO_TICKS(200)) { // 200ms
295295
return;
296296
}
297297
lastClick = currentTick;

src/displayapp/screens/WatchFaceCasioStyleAE21W.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace Pinetime {
5151
static bool IsAvailable(Pinetime::Controllers::FS& filesystem);
5252

5353
private:
54-
uint32_t savedTick = 0;
54+
TickType_t savedTick = 0;
5555

5656
Utility::DirtyValue<uint8_t> batteryPercentRemaining {};
5757
Utility::DirtyValue<bool> isCharging {};

0 commit comments

Comments
 (0)