From 4a1d2d816c4dff8b3c3e472f7b8022362e1ad109 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 12 Apr 2021 19:34:31 -0500 Subject: [PATCH] Update old-style axis indexes --- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 6 +++--- Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp | 2 +- Marlin/src/lcd/extui/ui_api.cpp | 10 +++++----- Marlin/src/module/tool_change.cpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index cc54354ed..faac398a4 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -668,9 +668,9 @@ void MarlinUI::draw_status_screen() { // lcd.setCursor(0, 0); - _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position[X_AXIS])), blink); lcd.write(' '); - _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position[Y_AXIS])), blink); lcd.write(' '); - _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position[Z_AXIS])), blink); + _draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position.x)), blink); lcd.write(' '); + _draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position.y)), blink); lcd.write(' '); + _draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink); #if HAS_LEVELING && !HAS_HEATED_BED lcd.write(planner.leveling_active || blink ? '_' : ' '); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp index 6025968d3..a1818e6dd 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_printing.cpp @@ -252,7 +252,7 @@ void disp_print_time() { void disp_fan_Zpos() { char str_1[16]; - sprintf_P(public_buf_l, PSTR("%s"), dtostrf(current_position[Z_AXIS], 1, 3, str_1)); + sprintf_P(public_buf_l, PSTR("%s"), dtostrf(current_position.z, 1, 3, str_1)); lv_label_set_text(labelZpos, public_buf_l); } diff --git a/Marlin/src/lcd/extui/ui_api.cpp b/Marlin/src/lcd/extui/ui_api.cpp index 9d89447e3..17e869d44 100644 --- a/Marlin/src/lcd/extui/ui_api.cpp +++ b/Marlin/src/lcd/extui/ui_api.cpp @@ -870,19 +870,19 @@ namespace ExtUI { const feedRate_t old_feedrate = feedrate_mm_s; const float x_target = MESH_MIN_X + pos.x * (MESH_X_DIST), y_target = MESH_MIN_Y + pos.y * (MESH_Y_DIST); - if (x_target != current_position[X_AXIS] || y_target != current_position[Y_AXIS]) { + if (x_target != current_position.x || y_target != current_position.y) { // If moving across bed, raise nozzle to safe height over bed feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; destination = current_position; - destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES; + destination.z = Z_CLEARANCE_BETWEEN_PROBES; prepare_line_to_destination(); feedrate_mm_s = XY_PROBE_FEEDRATE; - destination[X_AXIS] = x_target; - destination[Y_AXIS] = y_target; + destination.x = x_target; + destination.y = y_target; prepare_line_to_destination(); } feedrate_mm_s = Z_PROBE_FEEDRATE_FAST; - destination[Z_AXIS] = z; + destination.z = z; prepare_line_to_destination(); feedrate_mm_s = old_feedrate; #else diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 1ed395dfe..0475af6ad 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -846,9 +846,9 @@ inline void fast_line_to_current(const AxisEnum fr_axis) { _line_to_current(fr_a // Cutting recover unscaled_e_move(toolchange_settings.extra_resume + TOOLCHANGE_FS_WIPE_RETRACT, MMM_TO_MMS(toolchange_settings.unretract_speed)); - planner.synchronize(); + // Resume at the old E position current_position.e = destination.e; - sync_plan_position_e(); // Resume at the old E position + sync_plan_position_e(); } }