diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-08-30 07:15:19 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-08-30 07:15:19 (GMT) |
| commit | 21d37d1e234b217b3e71dc65eb19db197ee21bad (patch) | |
| tree | d1082c3dbcddd6d56fbb0f14fc9100f1efbfe441 /src/displayapp/screens/Notifications.cpp | |
| parent | 085c9ab2e15b35af01d73e823a87994a7a24a76f (diff) | |
| parent | 6c023785e53c507f7cb20703f5f3a221ea095068 (diff) | |
Merge remote-tracking branch 'upstream/develop' into timer_battery_reading
Diffstat (limited to 'src/displayapp/screens/Notifications.cpp')
| -rw-r--r-- | src/displayapp/screens/Notifications.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index c061c14..fd0b86d 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -52,15 +52,18 @@ Notifications::Notifications(DisplayApp* app, 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); // make sure we stop any vibrations before exiting Controllers::MotorController::StopRinging(); lv_obj_clean(lv_scr_act()); } -bool Notifications::Refresh() { +void Notifications::Refresh() { if (mode == Modes::Preview && timeoutLine != nullptr) { auto tick = xTaskGetTickCount(); int32_t pos = 240 - ((tick - timeoutTickCountStart) / ((timeoutTickCountEnd - timeoutTickCountStart) / 240)); @@ -70,7 +73,7 @@ bool Notifications::Refresh() { timeoutLinePoints[1].x = pos; lv_line_set_points(timeoutLine, timeoutLinePoints, 2); } - return running && currentItem->IsRunning(); + running = currentItem->IsRunning(); } bool Notifications::OnTouchEvent(Pinetime::Applications::TouchEvents event) { |
