Browse Source

Simplify configuration of Z2 endstops

Scott Lahteine 8 years ago
parent
commit
868eebfdee

+ 41
- 0
Marlin/Conditionals.h View File

@@ -504,6 +504,47 @@
504 504
   #define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1)
505 505
 
506 506
   /**
507
+   * Z_DUAL_ENDSTOPS endstop reassignment
508
+   */
509
+  #if ENABLED(Z_DUAL_ENDSTOPS)
510
+    #define _XMIN_ 100
511
+    #define _YMIN_ 200
512
+    #define _ZMIN_ 300
513
+    #define _XMAX_ 101
514
+    #define _YMAX_ 201
515
+    #define _ZMAX_ 301
516
+    const bool Z2_MAX_ENDSTOP_INVERTING =
517
+      #if Z2_USE_ENDSTOP == _XMAX_
518
+        X_MAX_ENDSTOP_INVERTING
519
+        #define Z2_MAX_PIN X_MAX_PIN
520
+        #undef USE_XMAX_PLUG
521
+      #elif Z2_USE_ENDSTOP == _YMAX_
522
+        Y_MAX_ENDSTOP_INVERTING
523
+        #define Z2_MAX_PIN Y_MAX_PIN
524
+        #undef USE_YMAX_PLUG
525
+      #elif Z2_USE_ENDSTOP == _ZMAX_
526
+        Z_MAX_ENDSTOP_INVERTING
527
+        #define Z2_MAX_PIN Z_MAX_PIN
528
+        #undef USE_ZMAX_PLUG
529
+      #elif Z2_USE_ENDSTOP == _XMIN_
530
+        X_MIN_ENDSTOP_INVERTING
531
+        #define Z2_MAX_PIN X_MIN_PIN
532
+        #undef USE_XMIN_PLUG
533
+      #elif Z2_USE_ENDSTOP == _YMIN_
534
+        Y_MIN_ENDSTOP_INVERTING
535
+        #define Z2_MAX_PIN Y_MIN_PIN
536
+        #undef USE_YMIN_PLUG
537
+      #elif Z2_USE_ENDSTOP == _ZMIN_
538
+        Z_MIN_ENDSTOP_INVERTING
539
+        #define Z2_MAX_PIN Z_MIN_PIN
540
+        #undef USE_ZMIN_PLUG
541
+      #else
542
+        0
543
+      #endif
544
+    ;
545
+  #endif
546
+
547
+  /**
507 548
    * Shorthand for pin tests, used wherever needed
508 549
    */
509 550
   #define HAS_TEMP_0 (PIN_EXISTS(TEMP_0) && TEMP_SENSOR_0 != 0 && TEMP_SENSOR_0 != -2)

+ 1
- 3
Marlin/Configuration_adv.h View File

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

+ 2
- 0
Marlin/SanityCheck.h View File

@@ -469,6 +469,8 @@
469 469
   #error FILAMENT_SENSOR is deprecated. Use FILAMENT_WIDTH_SENSOR instead.
470 470
 #elif defined(DISABLE_MAX_ENDSTOPS) || defined(DISABLE_MIN_ENDSTOPS)
471 471
   #error DISABLE_MAX_ENDSTOPS and DISABLE_MIN_ENDSTOPS deprecated - set USE_*_ENDSTOP flags instead
472
+#elif ENABLED(Z_DUAL_ENDSTOPS) && !defined(Z2_USE_ENDSTOP)
473
+  #error Z_DUAL_ENDSTOPS settings are simplified. Just set Z2_USE_ENDSTOP to the endstop you want to repurpose for Z2
472 474
 #endif
473 475
 
474 476
 #endif //SANITYCHECK_H

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -207,9 +207,7 @@
207 207
   //#define Z_DUAL_ENDSTOPS
208 208
 
209 209
   #if ENABLED(Z_DUAL_ENDSTOPS)
210
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
211
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
212
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
210
+    #define Z2_USE_ENDSTOP _XMAX_
213 211
   #endif
214 212
 
215 213
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -209,9 +209,7 @@
209 209
   //#define Z_DUAL_ENDSTOPS
210 210
 
211 211
   #if ENABLED(Z_DUAL_ENDSTOPS)
212
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
213
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
214
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
212
+    #define Z2_USE_ENDSTOP _XMAX_
215 213
   #endif
216 214
 
217 215
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -206,9 +206,7 @@
206 206
   //#define Z_DUAL_ENDSTOPS
207 207
 
208 208
   #if ENABLED(Z_DUAL_ENDSTOPS)
209
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
210
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
211
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
209
+    #define Z2_USE_ENDSTOP _XMAX_
212 210
   #endif
213 211
 
214 212
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

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

@@ -201,9 +201,7 @@
201 201
   //#define Z_DUAL_ENDSTOPS
202 202
 
203 203
   #if ENABLED(Z_DUAL_ENDSTOPS)
204
-    #define Z2_MAX_PIN 36                     //Endstop used for Z2 axis. In this case I'm using XMAX in a Rumba Board (pin 36)
205
-    const bool Z2_MAX_ENDSTOP_INVERTING = false;
206
-    #define DISABLE_XMAX_ENDSTOP              //Better to disable the XMAX to avoid conflict. Just rename "XMAX_ENDSTOP" by the endstop you are using for Z2 axis.
204
+    #define Z2_USE_ENDSTOP _XMAX_
207 205
   #endif
208 206
 
209 207
 #endif // Z_DUAL_STEPPER_DRIVERS

Loading…
Cancel
Save