summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/WatchFaceDigital.cpp
diff options
context:
space:
mode:
authorhubmartin <hub.martin@gmail.com>2021-09-16 20:04:31 (GMT)
committerhubmartin <hub.martin@gmail.com>2021-09-16 20:04:31 (GMT)
commit27366bdfdf05a5fd3128ad8eabedbeba720ca885 (patch)
tree94bf7fe9e60c7c88d269e207acb197915eb98660 /src/displayapp/screens/WatchFaceDigital.cpp
parentdb50131ed49f2fdb639799ca12839862340f8396 (diff)
parent3eb73774a39e255cd4b5de76441a59f1525a989c (diff)
Merge branch 'develop' into wake-time
Diffstat (limited to 'src/displayapp/screens/WatchFaceDigital.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index 2b902b3..58ab619 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;
}