diff options
author | JF002 <JF002@users.noreply.github.com> | 2021-08-28 16:39:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 16:39:48 +0200 |
commit | 2870d3ae6c00f127883e6cedecda328994b0fec7 (patch) | |
tree | 75c4b96ace962cbb965c2bdd0dd11137b471c5ac /src/displayapp/screens/WatchFaceDigital.cpp | |
parent | fab49f8557ef8ff38fe4f607e33b18fb5a1aeb9a (diff) | |
parent | c2fae47391f02b515c8d85a00ae1b7190bcd30a0 (diff) |
Merge pull request #497 from Riksu9000/refresh_rework
Rework Refresh
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
-rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 2b902b3b..58ab6190 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -91,13 +91,17 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app, lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7)); lv_label_set_text(stepIcon, Symbols::shoe); lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0); + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); + Refresh(); } WatchFaceDigital::~WatchFaceDigital() { + lv_task_del(taskRefresh); lv_obj_clean(lv_scr_act()); } -bool WatchFaceDigital::Refresh() { +void WatchFaceDigital::Refresh() { batteryPercentRemaining = batteryController.PercentRemaining(); if (batteryPercentRemaining.IsUpdated()) { auto batteryPercent = batteryPercentRemaining.Get(); @@ -219,6 +223,4 @@ bool WatchFaceDigital::Refresh() { lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0); lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0); } - - return running; } |