summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Motion.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2021-09-02 18:35:56 (GMT)
committerGitea <gitea@fake.local>2021-09-02 18:35:56 (GMT)
commit6c3d6fb2575888e582e7ef3004a0bc3bf6c588b6 (patch)
treeac396c060b423dd98fd915e742c14fc457a6f6d9 /src/displayapp/screens/Motion.cpp
parentdb6a701644116932f11c54ee0f619464de9faeb7 (diff)
parent6f9f0e8b0e42a5526d47ca664534fb6b0ccb6ace (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/displayapp/screens/Motion.cpp')
-rw-r--r--src/displayapp/screens/Motion.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index a8bb3c1..2f1f7c2 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -32,31 +32,30 @@ 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());
lv_label_set_text_fmt(labelStep, "Steps %lu", motionController.NbSteps());
- 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_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() {
- running = false;
- return true;
}