summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Motion.cpp
diff options
context:
space:
mode:
authorRiku Isokoski <riksu9000@gmail.com>2021-07-19 16:26:12 +0300
committerRiku Isokoski <riksu9000@gmail.com>2021-07-19 16:26:12 +0300
commit97c761a5c74994ea1d9bef9c14e6e24afb9b4be2 (patch)
tree11bbbe45fa4e1557cc5e3b7da08c1c380741c9c2 /src/displayapp/screens/Motion.cpp
parent57b339707861c5688f5d432f1506a99df6bb0fce (diff)
Refresh rework
Diffstat (limited to 'src/displayapp/screens/Motion.cpp')
-rw-r--r--src/displayapp/screens/Motion.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index a8bb3c18..108b942d 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -32,18 +32,20 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr
lv_label_set_align(label, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
lv_label_set_recolor(label, true);
-
+
labelStep = lv_label_create(lv_scr_act(), NULL);
lv_obj_align(labelStep, chart, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
lv_label_set_text(labelStep, "Steps ---");
+ taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
}
Motion::~Motion() {
+ lv_task_del(taskRefresh);
lv_obj_clean(lv_scr_act());
}
-bool Motion::Refresh() {
+void Motion::Refresh() {
lv_chart_set_next(chart, ser1, motionController.X());
lv_chart_set_next(chart, ser2, motionController.Y());
lv_chart_set_next(chart, ser3, motionController.Z());
@@ -52,8 +54,6 @@ bool Motion::Refresh() {
lv_label_set_text_fmt(label, "X #FF0000 %d# Y #008000 %d# Z #FFFF00 %d#", motionController.X() / 0x10, motionController.Y() / 0x10, motionController.Z() / 0x10);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
-
- return running;
}
bool Motion::OnButtonPushed() {