summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/WatchFaceAnalog.cpp
diff options
context:
space:
mode:
authorJF002 <JF002@users.noreply.github.com>2021-08-28 16:39:48 +0200
committerGitHub <noreply@github.com>2021-08-28 16:39:48 +0200
commit2870d3ae6c00f127883e6cedecda328994b0fec7 (patch)
tree75c4b96ace962cbb965c2bdd0dd11137b471c5ac /src/displayapp/screens/WatchFaceAnalog.cpp
parentfab49f8557ef8ff38fe4f607e33b18fb5a1aeb9a (diff)
parentc2fae47391f02b515c8d85a00ae1b7190bcd30a0 (diff)
Merge pull request #497 from Riksu9000/refresh_rework
Rework Refresh
Diffstat (limited to 'src/displayapp/screens/WatchFaceAnalog.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceAnalog.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/displayapp/screens/WatchFaceAnalog.cpp b/src/displayapp/screens/WatchFaceAnalog.cpp
index 1410fc28..75e35c1b 100644
--- a/src/displayapp/screens/WatchFaceAnalog.cpp
+++ b/src/displayapp/screens/WatchFaceAnalog.cpp
@@ -118,10 +118,13 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
lv_style_set_line_rounded(&hour_line_style_trace, LV_STATE_DEFAULT, false);
lv_obj_add_style(hour_body_trace, LV_LINE_PART_MAIN, &hour_line_style_trace);
+ taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
UpdateClock();
}
WatchFaceAnalog::~WatchFaceAnalog() {
+ lv_task_del(taskRefresh);
+
lv_style_reset(&hour_line_style);
lv_style_reset(&hour_line_style_trace);
lv_style_reset(&minute_line_style);
@@ -173,7 +176,7 @@ void WatchFaceAnalog::UpdateClock() {
}
}
-bool WatchFaceAnalog::Refresh() {
+void WatchFaceAnalog::Refresh() {
batteryPercentRemaining = batteryController.PercentRemaining();
if (batteryPercentRemaining.IsUpdated()) {
auto batteryPercent = batteryPercentRemaining.Get();
@@ -203,6 +206,4 @@ bool WatchFaceAnalog::Refresh() {
currentDay = day;
}
}
-
- return true;
}