From 035ecb26687a4c5b3ba1080a4249b3e0b9f0b2b1 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Fri, 1 Apr 2022 23:36:33 +0200 Subject: more fixes and try to display jump 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; } -- cgit v0.10.2