diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 95eb0c4b0fb1ddd8adb242c3dfc4dd745494784d..abde757bda69064203ce6e6838cd6cad19333c07 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 219ab0d7e3c82b608e398d94ee6e872aae3929f4..42dbc045bf1d618ee72813742cac7932f69d965c 100755 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -1303,11 +1303,7 @@ bool get_target_extruder_from_command(int code) { #if ENABLED(DUAL_X_CARRIAGE) - #define DXC_FULL_CONTROL_MODE 0 - #define DXC_AUTO_PARK_MODE 1 - #define DXC_DUPLICATION_MODE 2 - - static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; + static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE; static float x_home_pos(int extruder) { if (extruder == 0) @@ -6950,7 +6946,7 @@ inline void gcode_M503() { */ inline void gcode_M605() { stepper.synchronize(); - if (code_seen('S')) dual_x_carriage_mode = code_value_byte(); + if (code_seen('S')) dual_x_carriage_mode = (DualXMode)code_value_byte(); switch (dual_x_carriage_mode) { case DXC_DUPLICATION_MODE: if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0)); diff --git a/Marlin/enum.h b/Marlin/enum.h index 713f3b64c0717798b2d6a024bf35d4abf5f431d8..d7042e2a86c40563f5fa72cc58116372d7294ae6 100644 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -194,4 +194,12 @@ enum LCDViewAction { LCDVIEW_CALL_NO_REDRAW }; +#if ENABLED(DUAL_X_CARRIAGE) + enum DualXMode { + DXC_FULL_CONTROL_MODE, + DXC_AUTO_PARK_MODE, + DXC_DUPLICATION_MODE + }; +#endif + #endif // __ENUM_H__ diff --git a/Marlin/example_configurations/Cartesio/Configuration_adv.h b/Marlin/example_configurations/Cartesio/Configuration_adv.h index dc8b7823d08b96383904eda106dcfc8c8bb345df..c7aa0e89dfc24af5ea101f8ba3c22b08fee4316f 100644 --- a/Marlin/example_configurations/Cartesio/Configuration_adv.h +++ b/Marlin/example_configurations/Cartesio/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/Felix/Configuration_adv.h b/Marlin/example_configurations/Felix/Configuration_adv.h index c3d24860abf1fdfa15b9a4bbb16fe36ff638b5c4..0b76b4cb3b07b12ae9fcb3d41ffc76831de8c724 100644 --- a/Marlin/example_configurations/Felix/Configuration_adv.h +++ b/Marlin/example_configurations/Felix/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/Hephestos/Configuration_adv.h b/Marlin/example_configurations/Hephestos/Configuration_adv.h index e86bcbe443a6d0e613a51ff2ecc62f237860627b..5f56e84038f0497057c3781dc22364950398dfd2 100644 --- a/Marlin/example_configurations/Hephestos/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h index 4ab583e3b2eac32dfe04f0e98d98c38dc56e0ad2..769e58daeb061c90a58ed605d3174a01024d73e2 100644 --- a/Marlin/example_configurations/Hephestos_2/Configuration_adv.h +++ b/Marlin/example_configurations/Hephestos_2/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/K8200/Configuration_adv.h b/Marlin/example_configurations/K8200/Configuration_adv.h index 8bc63b84a2798aa784afd3d24987f9f010dfc07f..174bf821b61883ebd32ca610e9c89441b72b9676 100644 --- a/Marlin/example_configurations/K8200/Configuration_adv.h +++ b/Marlin/example_configurations/K8200/Configuration_adv.h @@ -319,7 +319,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/K8400/Configuration_adv.h b/Marlin/example_configurations/K8400/Configuration_adv.h index 10619302972ec26ab574e45834521b185a88c077..78661340f4255a98a849444d685de15522d11d9a 100644 --- a/Marlin/example_configurations/K8400/Configuration_adv.h +++ b/Marlin/example_configurations/K8400/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/RigidBot/Configuration_adv.h b/Marlin/example_configurations/RigidBot/Configuration_adv.h index e77c60c9cbac68dcc146db15a936d6a9b9e30caa..92c25ebcd8df5440b7a37f22ac473217c72ee678 100644 --- a/Marlin/example_configurations/RigidBot/Configuration_adv.h +++ b/Marlin/example_configurations/RigidBot/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/SCARA/Configuration_adv.h b/Marlin/example_configurations/SCARA/Configuration_adv.h index f4ebfb3b77ef766768a8f037e4aa6da629c1529c..43ba636aa3e3e289c1dbdae6c63d35ae03ddf898 100644 --- a/Marlin/example_configurations/SCARA/Configuration_adv.h +++ b/Marlin/example_configurations/SCARA/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/TAZ4/Configuration_adv.h b/Marlin/example_configurations/TAZ4/Configuration_adv.h index f3e15eb438cadfaf58508fbfb97aa0c006f0ccea..4e580a09c59e256f399bfe3d632e2bf68a080320 100644 --- a/Marlin/example_configurations/TAZ4/Configuration_adv.h +++ b/Marlin/example_configurations/TAZ4/Configuration_adv.h @@ -321,7 +321,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/WITBOX/Configuration_adv.h b/Marlin/example_configurations/WITBOX/Configuration_adv.h index e86bcbe443a6d0e613a51ff2ecc62f237860627b..5f56e84038f0497057c3781dc22364950398dfd2 100644 --- a/Marlin/example_configurations/WITBOX/Configuration_adv.h +++ b/Marlin/example_configurations/WITBOX/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h index 3932d5920c1d2c8d0852eec3025dd7eeedae8c35..7d952deedd1ba0ab06de8bc94e8cc3a0972d463b 100644 --- a/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h +++ b/Marlin/example_configurations/delta/biv2.5/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/delta/generic/Configuration_adv.h b/Marlin/example_configurations/delta/generic/Configuration_adv.h index 873d634cf968d80ae3b92be17509f6d1bd2e0466..c41d39fbc1b5fc741de87e3a306570686db9d7b9 100644 --- a/Marlin/example_configurations/delta/generic/Configuration_adv.h +++ b/Marlin/example_configurations/delta/generic/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h index 873d634cf968d80ae3b92be17509f6d1bd2e0466..c41d39fbc1b5fc741de87e3a306570686db9d7b9 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h index 06a3c97982c8e50c44af07afb3dd235d0fdf0b16..ef8880254f0b338b58827bf3eb5f0e0fa87a0489 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h @@ -318,7 +318,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h index 17b07b5e855aa5cf526b5aae62061c4e0e3bd2d9..76315719387b3126d7716def41877a73d9f1ef78 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/makibox/Configuration_adv.h b/Marlin/example_configurations/makibox/Configuration_adv.h index bb6afc9289a173adb941619f92944bc3fbc4a997..0e6059a570b431478a7e7e7b8d8ae8e42ef5477b 100644 --- a/Marlin/example_configurations/makibox/Configuration_adv.h +++ b/Marlin/example_configurations/makibox/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h index 2e57f8c7ba7beb0b0889946aef494e7b5b0882b8..ed951b31cbf3e0b08acf2f647cd26d07405bb6cd 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h @@ -313,7 +313,7 @@ // once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm]) // This is the default power-up mode which can be later using M605. - #define DEFAULT_DUAL_X_CARRIAGE_MODE 0 + #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE // Default settings in "Auto-park Mode" #define TOOLCHANGE_PARK_ZLIFT 0.2 // the distance to raise Z axis when parking an extruder