diff options
author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-19 16:26:12 +0300 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2021-07-19 16:26:12 +0300 |
commit | 97c761a5c74994ea1d9bef9c14e6e24afb9b4be2 (patch) | |
tree | 11bbbe45fa4e1557cc5e3b7da08c1c380741c9c2 /src/displayapp/screens/PineTimeStyle.cpp | |
parent | 57b339707861c5688f5d432f1506a99df6bb0fce (diff) |
Refresh rework
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 591f3a49..c595223a 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/PineTimeStyle.cpp @@ -200,13 +200,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(); @@ -335,6 +339,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 +} |