diff --git a/Marlin/Conditionals_LCD.h b/Marlin/Conditionals_LCD.h index 3f2410b8d2df1d8360ed1d8ba148f45fc2cf01a8..d431424a4811e3f269eda1368067dbaad0f0d6c5 100644 --- a/Marlin/Conditionals_LCD.h +++ b/Marlin/Conditionals_LCD.h @@ -403,9 +403,6 @@ #undef HOTEND_OFFSET_Y #else // Two hotends #define HOTENDS EXTRUDERS - #if ENABLED(SWITCHING_NOZZLE) && !defined(HOTEND_OFFSET_Z) - #define HOTEND_OFFSET_Z { 0 } - #endif #endif #if ENABLED(SWITCHING_EXTRUDER) // One stepper for every two EXTRUDERS diff --git a/Marlin/Conditionals_post.h b/Marlin/Conditionals_post.h index 26c255ce8ccd19b09256d029a1d401aff47a3614..6049931c2bb52a0e917f6b9ffee1ef2cd9b108a5 100644 --- a/Marlin/Conditionals_post.h +++ b/Marlin/Conditionals_post.h @@ -384,6 +384,7 @@ /** * Default hotend offsets, if not defined */ + #define HAS_HOTEND_OFFSET_Z (HOTENDS > 1 && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER))) #if HOTENDS > 1 #ifndef HOTEND_OFFSET_X #define HOTEND_OFFSET_X { 0 } // X offsets for each extruder @@ -391,7 +392,7 @@ #ifndef HOTEND_OFFSET_Y #define HOTEND_OFFSET_Y { 0 } // Y offsets for each extruder #endif - #if !defined(HOTEND_OFFSET_Z) && (ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE)) + #if HAS_HOTEND_OFFSET_Z && !defined(HOTEND_OFFSET_Z) #define HOTEND_OFFSET_Z { 0 } #endif #endif diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index cbeb7deadd2b749bf37c4539f4c11e0fabb49071..b62635da9a8f52bcf1023af47b0f5dd340e3e7f3 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -9332,7 +9332,7 @@ inline void gcode_M211() { * T<tool> * X<xoffset> * Y<yoffset> - * Z<zoffset> - Available with DUAL_X_CARRIAGE and SWITCHING_NOZZLE + * Z<zoffset> - Available with DUAL_X_CARRIAGE, SWITCHING_NOZZLE, and PARKING_EXTRUDER */ inline void gcode_M218() { if (get_target_extruder_from_command(218) || target_extruder == 0) return; @@ -9347,7 +9347,7 @@ inline void gcode_M211() { report = false; } - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) + #if HAS_HOTEND_OFFSET_Z if (parser.seenval('Z')) { hotend_offset[Z_AXIS][target_extruder] = parser.value_linear_units(); report = false; @@ -9362,7 +9362,7 @@ inline void gcode_M211() { SERIAL_ECHO(hotend_offset[X_AXIS][e]); SERIAL_CHAR(','); SERIAL_ECHO(hotend_offset[Y_AXIS][e]); - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) || ENABLED(PARKING_EXTRUDER) + #if HAS_HOTEND_OFFSET_Z SERIAL_CHAR(','); SERIAL_ECHO(hotend_offset[Z_AXIS][e]); #endif diff --git a/Marlin/configuration_store.cpp b/Marlin/configuration_store.cpp index 707513e1095b17ce276a75324e6f18d4e2056d9f..66926643b13b7cdd0fe8ac45aa62d9b88455abb8 100644 --- a/Marlin/configuration_store.cpp +++ b/Marlin/configuration_store.cpp @@ -1718,7 +1718,7 @@ void MarlinSettings::reset() { constexpr float tmp4[XYZ][HOTENDS] = { HOTEND_OFFSET_X, HOTEND_OFFSET_Y - #ifdef HOTEND_OFFSET_Z + #if HAS_HOTEND_OFFSET_Z , HOTEND_OFFSET_Z #else , { 0 } @@ -2109,7 +2109,7 @@ void MarlinSettings::reset() { SERIAL_ECHOPAIR(" M218 T", (int)e); SERIAL_ECHOPAIR(" X", LINEAR_UNIT(hotend_offset[X_AXIS][e])); SERIAL_ECHOPAIR(" Y", LINEAR_UNIT(hotend_offset[Y_AXIS][e])); - #if ENABLED(DUAL_X_CARRIAGE) || ENABLED(SWITCHING_NOZZLE) ||ENABLED(PARKING_EXTRUDER) + #if HAS_HOTEND_OFFSET_Z SERIAL_ECHOPAIR(" Z", LINEAR_UNIT(hotend_offset[Z_AXIS][e])); #endif SERIAL_EOL();