diff options
| author | JF002 <JF002@users.noreply.github.com> | 2021-08-28 14:39:48 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-28 14:39:48 (GMT) |
| commit | 2870d3ae6c00f127883e6cedecda328994b0fec7 (patch) | |
| tree | 75c4b96ace962cbb965c2bdd0dd11137b471c5ac /src/displayapp/screens/PineTimeStyle.cpp | |
| parent | fab49f8557ef8ff38fe4f607e33b18fb5a1aeb9a (diff) | |
| parent | c2fae47391f02b515c8d85a00ae1b7190bcd30a0 (diff) | |
Merge pull request #497 from Riksu9000/refresh_rework
Rework Refresh
Diffstat (limited to 'src/displayapp/screens/PineTimeStyle.cpp')
| -rw-r--r-- | src/displayapp/screens/PineTimeStyle.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/PineTimeStyle.cpp index 98fd976..04481a8 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -193,13 +193,17 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, lv_obj_set_size(backgroundLabel, 240, 240); lv_obj_set_pos(backgroundLabel, 0, 0); lv_label_set_text(backgroundLabel, ""); + + taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this); + Refresh(); } PineTimeStyle::~PineTimeStyle() { + lv_task_del(taskRefresh); lv_obj_clean(lv_scr_act()); } -bool PineTimeStyle::Refresh() { +void PineTimeStyle::Refresh() { batteryPercentRemaining = batteryController.PercentRemaining(); if (batteryPercentRemaining.IsUpdated()) { auto batteryPercent = batteryPercentRemaining.Get(); @@ -303,6 +307,4 @@ bool PineTimeStyle::Refresh() { lv_obj_set_style_local_scale_grad_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE); } } - - return running; -}
\ No newline at end of file +} |
