Browse Source

Make dual_x_carriage_mode an enumeration

Scott Lahteine 8 years ago
parent
commit
2495ab7af2

+ 1
- 1
Marlin/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 2
- 6
Marlin/Marlin_main.cpp View File

@@ -1303,11 +1303,7 @@ bool get_target_extruder_from_command(int code) {
1303 1303
 
1304 1304
 #if ENABLED(DUAL_X_CARRIAGE)
1305 1305
 
1306
-  #define DXC_FULL_CONTROL_MODE 0
1307
-  #define DXC_AUTO_PARK_MODE    1
1308
-  #define DXC_DUPLICATION_MODE  2
1309
-
1310
-  static int dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
1306
+  static DualXMode dual_x_carriage_mode = DEFAULT_DUAL_X_CARRIAGE_MODE;
1311 1307
 
1312 1308
   static float x_home_pos(int extruder) {
1313 1309
     if (extruder == 0)
@@ -6950,7 +6946,7 @@ inline void gcode_M503() {
6950 6946
    */
6951 6947
   inline void gcode_M605() {
6952 6948
     stepper.synchronize();
6953
-    if (code_seen('S')) dual_x_carriage_mode = code_value_byte();
6949
+    if (code_seen('S')) dual_x_carriage_mode = (DualXMode)code_value_byte();
6954 6950
     switch (dual_x_carriage_mode) {
6955 6951
       case DXC_DUPLICATION_MODE:
6956 6952
         if (code_seen('X')) duplicate_extruder_x_offset = max(code_value_axis_units(X_AXIS), X2_MIN_POS - x_home_pos(0));

+ 8
- 0
Marlin/enum.h View File

@@ -194,4 +194,12 @@ enum LCDViewAction {
194 194
   LCDVIEW_CALL_NO_REDRAW
195 195
 };
196 196
 
197
+#if ENABLED(DUAL_X_CARRIAGE)
198
+  enum DualXMode {
199
+    DXC_FULL_CONTROL_MODE,
200
+    DXC_AUTO_PARK_MODE,
201
+    DXC_DUPLICATION_MODE
202
+  };
203
+#endif
204
+
197 205
 #endif // __ENUM_H__

+ 1
- 1
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -319,7 +319,7 @@
319 319
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
320 320
 
321 321
   // This is the default power-up mode which can be later using M605.
322
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
322
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
323 323
 
324 324
   // Default settings in "Auto-park Mode"
325 325
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -321,7 +321,7 @@
321 321
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
322 322
 
323 323
   // This is the default power-up mode which can be later using M605.
324
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
324
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
325 325
 
326 326
   // Default settings in "Auto-park Mode"
327 327
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -318,7 +318,7 @@
318 318
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
319 319
 
320 320
   // This is the default power-up mode which can be later using M605.
321
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
321
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
322 322
 
323 323
   // Default settings in "Auto-park Mode"
324 324
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

+ 1
- 1
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -313,7 +313,7 @@
313 313
   //                           once. (2nd extruder x offset and temp offset are set using: M605 S2 [Xnnn] [Rmmm])
314 314
 
315 315
   // This is the default power-up mode which can be later using M605.
316
-  #define DEFAULT_DUAL_X_CARRIAGE_MODE 0
316
+  #define DEFAULT_DUAL_X_CARRIAGE_MODE DXC_FULL_CONTROL_MODE
317 317
 
318 318
   // Default settings in "Auto-park Mode"
319 319
   #define TOOLCHANGE_PARK_ZLIFT   0.2      // the distance to raise Z axis when parking an extruder

Loading…
Cancel
Save