From 56dd15c0ad7e9d41725511744866aa9c2e46c495 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Fri, 2 Dec 2016 22:40:18 -0600 Subject: [PATCH 01/11] Use SET_INPUT for PS_ON_PIN in kill --- Marlin/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c02c02c746..1599c7ba5b 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9950,7 +9950,7 @@ void kill(const char* lcd_msg) { disable_all_steppers(); #if HAS_POWER_SWITCH - pinMode(PS_ON_PIN, INPUT); + SET_INPUT(PS_ON_PIN); #endif suicide(); From ee50928eee74757d9d1fd33467b6ef1ee244b907 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 27 Nov 2016 21:07:23 -0600 Subject: [PATCH 02/11] Make LOGICAL and RAW position macros ternary-compatible --- Marlin/Marlin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Marlin.h b/Marlin/Marlin.h index 58d56cdbfe..0c3511ad7c 100644 --- a/Marlin/Marlin.h +++ b/Marlin/Marlin.h @@ -294,8 +294,8 @@ void update_software_endstops(AxisEnum axis); extern float soft_endstop_min[XYZ]; extern float soft_endstop_max[XYZ]; -#define LOGICAL_POSITION(POS, AXIS) (POS + home_offset[AXIS] + position_shift[AXIS]) -#define RAW_POSITION(POS, AXIS) (POS - home_offset[AXIS] - position_shift[AXIS]) +#define LOGICAL_POSITION(POS, AXIS) ((POS) + home_offset[AXIS] + position_shift[AXIS]) +#define RAW_POSITION(POS, AXIS) ((POS) - home_offset[AXIS] - position_shift[AXIS]) #define LOGICAL_X_POSITION(POS) LOGICAL_POSITION(POS, X_AXIS) #define LOGICAL_Y_POSITION(POS) LOGICAL_POSITION(POS, Y_AXIS) #define LOGICAL_Z_POSITION(POS) LOGICAL_POSITION(POS, Z_AXIS) From 053fb55af60a3b9bec7d2e65740e666e42917d42 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:18:44 -0600 Subject: [PATCH 03/11] Fix modes ordering in prepare_move_to_destination_dualx --- Marlin/Marlin_main.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 1599c7ba5b..da69727f1a 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9223,23 +9223,6 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: break; - case DXC_DUPLICATION_MODE: - if (active_extruder == 0) { - // move duplicate extruder into correct duplication position. - planner.set_position_mm( - LOGICAL_X_POSITION(inactive_extruder_x_pos), - current_position[Y_AXIS], - current_position[Z_AXIS], - current_position[E_AXIS] - ); - planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1); - SYNC_PLAN_POSITION_KINEMATIC(); - stepper.synchronize(); - extruder_duplication_enabled = true; - active_extruder_parked = false; - } - break; case DXC_AUTO_PARK_MODE: if (current_position[E_AXIS] == destination[E_AXIS]) { // This is a travel move (with no extrusion) @@ -9259,6 +9242,23 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder); active_extruder_parked = false; break; + case DXC_DUPLICATION_MODE: + if (active_extruder == 0) { + // move duplicate extruder into correct duplication position. + planner.set_position_mm( + LOGICAL_X_POSITION(inactive_extruder_x_pos), + current_position[Y_AXIS], + current_position[Z_AXIS], + current_position[E_AXIS] + ); + planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, + current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1); + SYNC_PLAN_POSITION_KINEMATIC(); + stepper.synchronize(); + extruder_duplication_enabled = true; + active_extruder_parked = false; + } + break; } } return true; From 41278c1e8b24b01cf01511631ec4afad5124281e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:20:19 -0600 Subject: [PATCH 04/11] Apply LOGICAL_POSITION to home positions on Dual X --- Marlin/Marlin_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index da69727f1a..d4cb4a027d 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1318,11 +1318,11 @@ bool get_target_extruder_from_command(int code) { else /** * In dual carriage mode the extruder offset provides an override of the - * second X-carriage offset when homed - otherwise X2_HOME_POS is used. - * This allow soft recalibration of the second extruder offset position + * second X-carriage position when homed - otherwise X2_HOME_POS is used. + * This allows soft recalibration of the second extruder home position * without firmware reflash (through the M218 command). */ - return (hotend_offset[X_AXIS][1] > 0) ? hotend_offset[X_AXIS][1] : X2_HOME_POS; + return LOGICAL_X_POSITION(hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS); } static int x_home_dir(int extruder) { From fe96f74db193eda4af5798f1aef25f3e2ae4a66b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:20:59 -0600 Subject: [PATCH 05/11] Use const arguments in Dual X helper functions --- Marlin/Marlin_main.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d4cb4a027d..ef31136cfb 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1312,7 +1312,7 @@ bool get_target_extruder_from_command(int code) { static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; - static float x_home_pos(int extruder) { + static float x_home_pos(const int extruder) { if (extruder == 0) return LOGICAL_X_POSITION(base_home_pos(X_AXIS)); else @@ -1325,9 +1325,7 @@ bool get_target_extruder_from_command(int code) { return LOGICAL_X_POSITION(hotend_offset[X_AXIS][1] > 0 ? hotend_offset[X_AXIS][1] : X2_HOME_POS); } - static int x_home_dir(int extruder) { - return (extruder == 0) ? X_HOME_DIR : X2_HOME_DIR; - } + static int x_home_dir(const int extruder) { return extruder ? X2_HOME_DIR : X_HOME_DIR; } static float inactive_extruder_x_pos = X2_MAX_POS; // used in mode 0 & 1 static bool active_extruder_parked = false; // used in mode 1 & 2 From 54109dfaec881477e151b5905515b155ab2dafc1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:33:12 -0600 Subject: [PATCH 06/11] Reduce code size for Dual X un-park --- Marlin/Marlin_main.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index ef31136cfb..dafaf4a3ec 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9233,11 +9233,17 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { return false; } } - delayed_move_time = 0; // unpark extruder: 1) raise, 2) move into starting XY position, 3) lower - planner.buffer_line(raised_parked_position[X_AXIS], raised_parked_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder); - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], raised_parked_position[Z_AXIS], current_position[E_AXIS], PLANNER_XY_FEEDRATE(), active_extruder); - planner.buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[Z_AXIS], active_extruder); + for (uint8_t i = 0; i < 3; i++) + planner.buffer_line( + i == 0 ? raised_parked_position[X_AXIS] : current_position[X_AXIS], + i == 0 ? raised_parked_position[Y_AXIS] : current_position[Y_AXIS], + i == 2 ? current_position[Z_AXIS] : raised_parked_position[Z_AXIS], + current_position[E_AXIS], + i == 1 ? PLANNER_XY_FEEDRATE() : planner.max_feedrate_mm_s[Z_AXIS], + active_extruder + ); + delayed_move_time = 0; active_extruder_parked = false; break; case DXC_DUPLICATION_MODE: From 0e15b4f434cee8df7738cd790b29f2957a368e0a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:23:39 -0600 Subject: [PATCH 07/11] Dual X set_axis_is_at_home can use x_home_pos for both --- Marlin/Marlin_main.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index dafaf4a3ec..e043228f22 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1432,12 +1432,8 @@ static void set_axis_is_at_home(AxisEnum axis) { update_software_endstops(axis); #if ENABLED(DUAL_X_CARRIAGE) - if (axis == X_AXIS && (active_extruder != 0 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { - if (active_extruder != 0) - current_position[X_AXIS] = x_home_pos(active_extruder); - else - current_position[X_AXIS] = LOGICAL_X_POSITION(base_home_pos(X_AXIS)); - update_software_endstops(X_AXIS); + if (axis == X_AXIS && (active_extruder == 1 || dual_x_carriage_mode == DXC_DUPLICATION_MODE)) { + current_position[X_AXIS] = x_home_pos(active_extruder); return; } #endif From ca24af7d5dc9f6a8c1584007c85f418d7ad61895 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:24:39 -0600 Subject: [PATCH 08/11] Dual X with home_z_safely is not parked --- Marlin/Marlin_main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e043228f22..c853d2117c 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3253,6 +3253,12 @@ inline void gcode_G4() { #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); #endif + + // This causes the carriage on Dual X to unpark + #if ENABLED(DUAL_X_CARRIAGE) + active_extruder_parked = false; + #endif + do_blocking_move_to_xy(destination[X_AXIS], destination[Y_AXIS]); HOMEAXIS(Z); } From b20405db316db9ac4788ac27d3fce286b0a77f11 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 02:46:16 -0600 Subject: [PATCH 09/11] Only DXC_AUTO_PARK_MODE should auto-move in tool_change --- Marlin/Marlin_main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index c853d2117c..cdb8e62df3 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7525,6 +7525,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n if (DEBUGGING(LEVELING)) DEBUG_POS("New Extruder", current_position); #endif + // Only when auto-parking are carriages safe to move + if (dual_x_carriage_mode != DXC_AUTO_PARK_MODE) no_move = true; + switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos); From 4217e9653e4f5dae457948f7e10da0a80eedd7a1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 7 Nov 2016 00:21:45 -0600 Subject: [PATCH 10/11] Adjust park code in tool_change --- Marlin/Marlin_main.cpp | 76 +++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cdb8e62df3..7fbc4f6c2f 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1416,6 +1416,7 @@ static void set_home_offset(AxisEnum axis, float v) { * current_position to home, because neither X nor Y is at home until * both are at home. Z can however be homed individually. * + * Callers must sync the planner position after calling this! */ static void set_axis_is_at_home(AxisEnum axis) { #if ENABLED(DEBUG_LEVELING_FEATURE) @@ -3246,10 +3247,12 @@ inline void gcode_G4() { #endif ) ) { + #if HOMING_Z_WITH_PROBE destination[X_AXIS] -= X_PROBE_OFFSET_FROM_EXTRUDER; destination[Y_AXIS] -= Y_PROBE_OFFSET_FROM_EXTRUDER; #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("Z_SAFE_HOMING", destination); #endif @@ -3407,20 +3410,31 @@ inline void gcode_G28() { // Home X if (home_all_axis || homeX) { + #if ENABLED(DUAL_X_CARRIAGE) - int tmp_extruder = active_extruder; - active_extruder = !active_extruder; + + // Always home the 2nd (right) extruder first + active_extruder = 1; HOMEAXIS(X); + + // Remember this extruder's position for later tool change inactive_extruder_x_pos = RAW_X_POSITION(current_position[X_AXIS]); - active_extruder = tmp_extruder; + + // Home the 1st (left) extruder + active_extruder = 0; HOMEAXIS(X); - // reset state used by the different modes + + // Consider the active extruder to be parked memcpy(raised_parked_position, current_position, sizeof(raised_parked_position)); delayed_move_time = 0; active_extruder_parked = true; + #else + HOMEAXIS(X); + #endif + #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) DEBUG_POS("> homeX", current_position); #endif @@ -7446,10 +7460,8 @@ inline void invalid_extruder_error(const uint8_t &e) { void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool no_move/*=false*/) { #if ENABLED(MIXING_EXTRUDER) && MIXING_VIRTUAL_TOOLS > 1 - if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) { - invalid_extruder_error(tmp_extruder); - return; - } + if (tmp_extruder >= MIXING_VIRTUAL_TOOLS) + return invalid_extruder_error(tmp_extruder); // T0-Tnnn: Switch virtual tool by changing the mix for (uint8_t j = 0; j < MIXING_STEPPERS; j++) @@ -7459,10 +7471,8 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n #if HOTENDS > 1 - if (tmp_extruder >= EXTRUDERS) { - invalid_extruder_error(tmp_extruder); - return; - } + if (tmp_extruder >= EXTRUDERS) + return invalid_extruder_error(tmp_extruder); float old_feedrate_mm_s = feedrate_mm_s; @@ -7490,22 +7500,28 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n } #endif - if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() && - (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder)) + const float xhome = x_home_pos(active_extruder); + if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE + && IsRunning() + && (delayed_move_time || current_position[X_AXIS] != xhome) ) { + float raised_z = current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT; + #if ENABLED(max_software_endstops) + NOMORE(raised_z, soft_endstop_max[Z_AXIS]); + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { - SERIAL_ECHOPAIR("Raise to ", current_position[Z_AXIS] + TOOLCHANGE_PARK_ZLIFT); SERIAL_EOL; - SERIAL_ECHOPAIR("MoveX to ", x_home_pos(active_extruder)); SERIAL_EOL; - SERIAL_ECHOPAIR("Lower to ", current_position[Z_AXIS]); SERIAL_EOL; + SERIAL_ECHOLNPAIR("Raise to ", raised_z); + SERIAL_ECHOLNPAIR("MoveX to ", xhome); + SERIAL_ECHOLNPAIR("Lower to ", current_position[Z_AXIS]); } #endif // Park old head: 1) raise 2) move to park position 3) lower for (uint8_t i = 0; i < 3; i++) planner.buffer_line( - i == 0 ? current_position[X_AXIS] : x_home_pos(active_extruder), + i == 0 ? current_position[X_AXIS] : xhome, current_position[Y_AXIS], - current_position[Z_AXIS] + (i == 2 ? 0 : TOOLCHANGE_PARK_ZLIFT), + i == 2 ? current_position[Z_AXIS] : raised_z, current_position[E_AXIS], planner.max_feedrate_mm_s[i == 1 ? X_AXIS : Z_AXIS], active_extruder @@ -7513,9 +7529,11 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n stepper.synchronize(); } - // apply Y & Z extruder offset (x offset is already used in determining home pos) + // Apply Y & Z extruder offset (X offset is used as home pos with Dual X) current_position[Y_AXIS] -= hotend_offset[Y_AXIS][active_extruder] - hotend_offset[Y_AXIS][tmp_extruder]; current_position[Z_AXIS] -= hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder]; + + // Activate the new extruder active_extruder = tmp_extruder; // This function resets the max/min values - the current position may be overwritten below. @@ -7530,7 +7548,9 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n switch (dual_x_carriage_mode) { case DXC_FULL_CONTROL_MODE: + // New current position is the position of the activated extruder current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos); + // Save the inactive extruder's position (from the old current_position) inactive_extruder_x_pos = RAW_X_POSITION(destination[X_AXIS]); break; case DXC_AUTO_PARK_MODE: @@ -7544,7 +7564,10 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n delayed_move_time = 0; break; case DXC_DUPLICATION_MODE: - active_extruder_parked = (active_extruder == 0); // this triggers the second extruder to move into the duplication position + // If the new extruder is the left one, set it "parked" + // This triggers the second extruder to move into the duplication position + active_extruder_parked = (active_extruder == 0); + if (active_extruder_parked) current_position[X_AXIS] = LOGICAL_X_POSITION(inactive_extruder_x_pos); else @@ -7569,9 +7592,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n float z_diff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder], z_raise = 0.3 + (z_diff > 0.0 ? z_diff : 0.0); - set_destination_to_current(); - - // Always raise by some amount + // Always raise by some amount (destination copied from current_position earlier) destination[Z_AXIS] += z_raise; planner.buffer_line_kinematic(destination, planner.max_feedrate_mm_s[Z_AXIS], active_extruder); stepper.synchronize(); @@ -9260,8 +9281,11 @@ void set_current_from_steppers_for_axis(const AxisEnum axis) { current_position[Z_AXIS], current_position[E_AXIS] ); - planner.buffer_line(current_position[X_AXIS] + duplicate_extruder_x_offset, - current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], planner.max_feedrate_mm_s[X_AXIS], 1); + planner.buffer_line( + current_position[X_AXIS] + duplicate_extruder_x_offset, + current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], + planner.max_feedrate_mm_s[X_AXIS], 1 + ); SYNC_PLAN_POSITION_KINEMATIC(); stepper.synchronize(); extruder_duplication_enabled = true; From c47e07d129106b513c0787555139e9fe82527138 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 3 Dec 2016 00:27:10 -0600 Subject: [PATCH 11/11] Fix Dual X software endstops --- Marlin/Marlin_main.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 7fbc4f6c2f..4e7a1b8f31 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1349,25 +1349,33 @@ void update_software_endstops(AxisEnum axis) { float offs = LOGICAL_POSITION(0, axis); #if ENABLED(DUAL_X_CARRIAGE) + bool did_update = false; if (axis == X_AXIS) { + + // In Dual X mode hotend_offset[X] is T1's home position float dual_max_x = max(hotend_offset[X_AXIS][1], X2_MAX_POS); + if (active_extruder != 0) { + // T1 can move from X2_MIN_POS to X2_MAX_POS or X2 home position (whichever is larger) soft_endstop_min[X_AXIS] = X2_MIN_POS + offs; soft_endstop_max[X_AXIS] = dual_max_x + offs; - return; } else if (dual_x_carriage_mode == DXC_DUPLICATION_MODE) { + // In Duplication Mode, T0 can move as far left as X_MIN_POS + // but not so far to the right that T1 would move past the end soft_endstop_min[X_AXIS] = base_min_pos(X_AXIS) + offs; soft_endstop_max[X_AXIS] = min(base_max_pos(X_AXIS), dual_max_x - duplicate_extruder_x_offset) + offs; - return; + } + else { + // In other modes, T0 can move from X_MIN_POS to X_MAX_POS + soft_endstop_min[axis] = base_min_pos(axis) + offs; + soft_endstop_max[axis] = base_max_pos(axis) + offs; } } - else - #endif - { + #else soft_endstop_min[axis] = base_min_pos(axis) + offs; soft_endstop_max[axis] = base_max_pos(axis) + offs; - } + #endif #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) {