From f1d4713097313813b53f8201a7bb9fba309f3e39 Mon Sep 17 00:00:00 2001 From: Rockman18 Date: Tue, 19 Jan 2021 23:27:57 +0100 Subject: [PATCH] Fix MKS UI manual move (#20813) --- Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp index 6db1810fc..d10175344 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_move_motor.cpp @@ -54,14 +54,18 @@ enum { static void event_handler(lv_obj_t *obj, lv_event_t event) { if (event != LV_EVENT_RELEASED) return; if (queue.length <= (BUFSIZE - 3)) { + bool do_inject = true; float dist = uiCfg.move_dist; switch (obj->mks_obj_id) { case ID_M_X_N: dist *= -1; case ID_M_X_P: cur_label = 'X'; break; case ID_M_Y_N: dist *= -1; case ID_M_Y_P: cur_label = 'Y'; break; case ID_M_Z_N: dist *= -1; case ID_M_Z_P: cur_label = 'Z'; break; + default: do_inject = false; + } + if (do_inject) { + sprintf_P(public_buf_l, PSTR("G91\nG1 %c%3.1f F%d\nG90"), cur_label, dist, uiCfg.moveSpeed); + queue.inject(public_buf_l); } - sprintf_P(public_buf_l, PSTR("G91\nG1 %c%3.1f F%d\nG90"), cur_label, dist, uiCfg.moveSpeed); - queue.inject(public_buf_l); } switch (obj->mks_obj_id) {