summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-01 21:36:33 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-01 21:36:33 (GMT)
commit035ecb26687a4c5b3ba1080a4249b3e0b9f0b2b1 (patch)
tree30f03e192e3cda9cd5259fe8c07aff3ad3b3e0aa
parent6c5fe5cf5b2018f9e601aefe3b8de1e117502b69 (diff)
more fixes and try to display jump
-rw-r--r--src/displayapp/screens/Motion.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index ba25084..3ac9f73 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -113,15 +113,15 @@ void Motion::Refresh() {
last_redraw_frame_time = current_time;
uint16_t G_uint16 = G < 0xffff ? G : 0xffff;
lv_chart_set_next(chart, ser1, 1000 - ((int16_t)G_uint16));
- labelText[4] = '0'+(G_uint16%10); G /= 10;
- labelText[3] = '0'+(G_uint16%10); G /= 10;
- labelText[2] = '0'+(G_uint16%10); G /= 10;
- labelText[1] = '0'+(G_uint16%10); G /= 10;
+ labelText[4] = '0'+(G_uint16%10); G_uint16 /= 10;
+ labelText[3] = '0'+(G_uint16%10); G_uint16 /= 10;
+ labelText[2] = '0'+(G_uint16%10); G_uint16 /= 10;
+ labelText[1] = '0'+(G_uint16%10); G_uint16 /= 10;
labelText[0] = '0'+G; G /= 10;
lv_label_set_text_static(label, labelText);
if (jump_started_or_ended) {
if (new_record) {
- lv_label_set_text_fmt(recordLabel, "%3.3f", current_jump_length);
+ lv_label_set_text_fmt(recordLabel, "%f", ((float)current_jump_length));
}
lv_color_t color;
if (jumping) {
@@ -129,7 +129,7 @@ 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, "%3.3f", current_jump_length);
+ lv_label_set_text_fmt(lastLabel, "%f", ((float)current_jump_length));
}
color = LV_COLOR_ORANGE;
}