summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Motion.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/Motion.cpp')
-rw-r--r--src/displayapp/screens/Motion.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index 601fbbf..6a0b543 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -18,8 +18,8 @@
using namespace Pinetime::Applications::Screens;
-Motion::Motion(Pinetime::Applications::DisplayApp* app, System::SystemTask& systemTask, Controllers::MotionController& motionController)
- : Screen(app), motionController {motionController}, systemTask {systemTask} {
+Motion::Motion(Pinetime::Applications::DisplayApp* app, System::SystemTask& systemTask, Controllers::MotionController& motionController, Controllers::MotorController& motorController)
+ : Screen(app), motionController {motionController}, motorController {motorController}, systemTask {systemTask} {
systemTask.PushMessage(Pinetime::System::Messages::DisableSleeping);
chart = lv_chart_create(lv_scr_act(), NULL);
@@ -122,7 +122,9 @@ void Motion::Refresh() {
lv_label_set_text_static(label, labelText);
if (jump_started_or_ended) {
if (new_record) {
- lv_label_set_text_fmt(recordLabel, "%f", ((float)current_jump_length));
+ uint32_t a = (current_jump_length*100000.0);
+ lv_label_set_text_fmt(recordLabel, "%d.%03d", a/1000, a%1000);
+ motorController.RunForDuration(35);
}
lv_color_t color;
if (jumping) {
@@ -130,7 +132,11 @@ void Motion::Refresh() {
} else {
double best_jump_length = records[0].jump_length;
if (current_jump_length * 100 > best_jump_length) {
- lv_label_set_text_fmt(lastLabel, "%f", ((float)current_jump_length));
+ uint32_t a = (current_jump_length*100000.0);
+ lv_label_set_text_fmt(recordLabel, "%d.%03d", a/1000, a%1000);
+ if (!new_record && current_jump_length > 0.05) {
+ motorController.RunForDuration(11);
+ }
}
color = LV_COLOR_ORANGE;
}