diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-19 13:26:12 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-07-19 13:26:12 (GMT) |
| commit | 97c761a5c74994ea1d9bef9c14e6e24afb9b4be2 (patch) | |
| tree | 11bbbe45fa4e1557cc5e3b7da08c1c380741c9c2 /src/displayapp/screens/Notifications.cpp | |
| parent | 57b339707861c5688f5d432f1506a99df6bb0fce (diff) | |
Refresh rework
Diffstat (limited to 'src/displayapp/screens/Notifications.cpp')
| -rw-r--r-- | src/displayapp/screens/Notifications.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 38b1242..33e50cc 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -47,13 +47,16 @@ Notifications::Notifications(DisplayApp* app, timeoutTickCountStart = xTaskGetTickCount(); timeoutTickCountEnd = timeoutTickCountStart + (5 * 1024); } + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); } Notifications::~Notifications() { + lv_task_del(taskRefresh); lv_obj_clean(lv_scr_act()); } -bool Notifications::Refresh() { +void Notifications::Refresh() { if (mode == Modes::Preview) { auto tick = xTaskGetTickCount(); int32_t pos = 240 - ((tick - timeoutTickCountStart) / ((timeoutTickCountEnd - timeoutTickCountStart) / 240)); @@ -63,8 +66,6 @@ bool Notifications::Refresh() { timeoutLinePoints[1].x = pos; lv_line_set_points(timeoutLine, timeoutLinePoints, 2); } - - return running; } bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { |
