Browse Source

Don't trigger endstops that are actually Z2 or probe

Scott Lahteine 8 years ago
parent
commit
9a23f73765
1 changed files with 35 additions and 33 deletions
  1. 35
    33
      Marlin/Conditionals_post.h

+ 35
- 33
Marlin/Conditionals_post.h View File

329
     #define _XMAX_ 101
329
     #define _XMAX_ 101
330
     #define _YMAX_ 201
330
     #define _YMAX_ 201
331
     #define _ZMAX_ 301
331
     #define _ZMAX_ 301
332
-    #if Z2_USE_ENDSTOP == _XMAX_
333
-      #define USE_XMAX_PLUG
334
-    #elif Z2_USE_ENDSTOP == _YMAX_
335
-      #define USE_YMAX_PLUG
336
-    #elif Z2_USE_ENDSTOP == _ZMAX_
337
-      #define USE_ZMAX_PLUG
338
-    #elif Z2_USE_ENDSTOP == _XMIN_
332
+    #if Z2_USE_ENDSTOP == _XMIN_
339
       #define USE_XMIN_PLUG
333
       #define USE_XMIN_PLUG
334
+    #elif Z2_USE_ENDSTOP == _XMAX_
335
+      #define USE_XMAX_PLUG
340
     #elif Z2_USE_ENDSTOP == _YMIN_
336
     #elif Z2_USE_ENDSTOP == _YMIN_
341
       #define USE_YMIN_PLUG
337
       #define USE_YMIN_PLUG
338
+    #elif Z2_USE_ENDSTOP == _YMAX_
339
+      #define USE_YMAX_PLUG
342
     #elif Z2_USE_ENDSTOP == _ZMIN_
340
     #elif Z2_USE_ENDSTOP == _ZMIN_
343
       #define USE_ZMIN_PLUG
341
       #define USE_ZMIN_PLUG
342
+    #elif Z2_USE_ENDSTOP == _ZMAX_
343
+      #define USE_ZMAX_PLUG
344
     #endif
344
     #endif
345
     #if Z_HOME_DIR > 0
345
     #if Z_HOME_DIR > 0
346
-      #if Z2_USE_ENDSTOP == _XMAX_
347
-        #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
348
-        #define Z2_MAX_PIN X_MAX_PIN
349
-      #elif Z2_USE_ENDSTOP == _YMAX_
350
-        #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
351
-        #define Z2_MAX_PIN Y_MAX_PIN
352
-      #elif Z2_USE_ENDSTOP == _ZMAX_
353
-        #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
354
-        #define Z2_MAX_PIN Z_MAX_PIN
355
-      #elif Z2_USE_ENDSTOP == _XMIN_
346
+      #if Z2_USE_ENDSTOP == _XMIN_
356
         #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
347
         #define Z2_MAX_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
357
         #define Z2_MAX_PIN X_MIN_PIN
348
         #define Z2_MAX_PIN X_MIN_PIN
349
+      #elif Z2_USE_ENDSTOP == _XMAX_
350
+        #define Z2_MAX_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
351
+        #define Z2_MAX_PIN X_MAX_PIN
358
       #elif Z2_USE_ENDSTOP == _YMIN_
352
       #elif Z2_USE_ENDSTOP == _YMIN_
359
         #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
353
         #define Z2_MAX_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
360
         #define Z2_MAX_PIN Y_MIN_PIN
354
         #define Z2_MAX_PIN Y_MIN_PIN
355
+      #elif Z2_USE_ENDSTOP == _YMAX_
356
+        #define Z2_MAX_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
357
+        #define Z2_MAX_PIN Y_MAX_PIN
361
       #elif Z2_USE_ENDSTOP == _ZMIN_
358
       #elif Z2_USE_ENDSTOP == _ZMIN_
362
         #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
359
         #define Z2_MAX_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
363
         #define Z2_MAX_PIN Z_MIN_PIN
360
         #define Z2_MAX_PIN Z_MIN_PIN
361
+      #elif Z2_USE_ENDSTOP == _ZMAX_
362
+        #define Z2_MAX_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
363
+        #define Z2_MAX_PIN Z_MAX_PIN
364
       #else
364
       #else
365
         #define Z2_MAX_ENDSTOP_INVERTING false
365
         #define Z2_MAX_ENDSTOP_INVERTING false
366
       #endif
366
       #endif
367
     #else
367
     #else
368
-      #if Z2_USE_ENDSTOP == _XMAX_
369
-        #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
370
-        #define Z2_MIN_PIN X_MAX_PIN
371
-      #elif Z2_USE_ENDSTOP == _YMAX_
372
-        #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
373
-        #define Z2_MIN_PIN Y_MAX_PIN
374
-      #elif Z2_USE_ENDSTOP == _ZMAX_
375
-        #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
376
-        #define Z2_MIN_PIN Z_MAX_PIN
377
-      #elif Z2_USE_ENDSTOP == _XMIN_
368
+      #if Z2_USE_ENDSTOP == _XMIN_
378
         #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
369
         #define Z2_MIN_ENDSTOP_INVERTING X_MIN_ENDSTOP_INVERTING
379
         #define Z2_MIN_PIN X_MIN_PIN
370
         #define Z2_MIN_PIN X_MIN_PIN
371
+      #elif Z2_USE_ENDSTOP == _XMAX_
372
+        #define Z2_MIN_ENDSTOP_INVERTING X_MAX_ENDSTOP_INVERTING
373
+        #define Z2_MIN_PIN X_MAX_PIN
380
       #elif Z2_USE_ENDSTOP == _YMIN_
374
       #elif Z2_USE_ENDSTOP == _YMIN_
381
         #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
375
         #define Z2_MIN_ENDSTOP_INVERTING Y_MIN_ENDSTOP_INVERTING
382
         #define Z2_MIN_PIN Y_MIN_PIN
376
         #define Z2_MIN_PIN Y_MIN_PIN
377
+      #elif Z2_USE_ENDSTOP == _YMAX_
378
+        #define Z2_MIN_ENDSTOP_INVERTING Y_MAX_ENDSTOP_INVERTING
379
+        #define Z2_MIN_PIN Y_MAX_PIN
383
       #elif Z2_USE_ENDSTOP == _ZMIN_
380
       #elif Z2_USE_ENDSTOP == _ZMIN_
384
         #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
381
         #define Z2_MIN_ENDSTOP_INVERTING Z_MIN_ENDSTOP_INVERTING
385
         #define Z2_MIN_PIN Z_MIN_PIN
382
         #define Z2_MIN_PIN Z_MIN_PIN
383
+      #elif Z2_USE_ENDSTOP == _ZMAX_
384
+        #define Z2_MIN_ENDSTOP_INVERTING Z_MAX_ENDSTOP_INVERTING
385
+        #define Z2_MIN_PIN Z_MAX_PIN
386
       #else
386
       #else
387
         #define Z2_MIN_ENDSTOP_INVERTING false
387
         #define Z2_MIN_ENDSTOP_INVERTING false
388
       #endif
388
       #endif
389
     #endif
389
     #endif
390
   #endif
390
   #endif
391
 
391
 
392
+  #define IS_Z2_OR_PROBE(P) (P == Z2_MIN_PIN || P == Z2_MAX_PIN || P == Z_MIN_PROBE_PIN)
393
+
392
   /**
394
   /**
393
    * Set ENDSTOPPULLUPS for active endstop switches
395
    * Set ENDSTOPPULLUPS for active endstop switches
394
    */
396
    */
452
   #define HAS_KILL (PIN_EXISTS(KILL))
454
   #define HAS_KILL (PIN_EXISTS(KILL))
453
   #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
455
   #define HAS_SUICIDE (PIN_EXISTS(SUICIDE))
454
   #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
456
   #define HAS_PHOTOGRAPH (PIN_EXISTS(PHOTOGRAPH))
455
-  #define HAS_X_MIN (PIN_EXISTS(X_MIN))
456
-  #define HAS_X_MAX (PIN_EXISTS(X_MAX))
457
-  #define HAS_Y_MIN (PIN_EXISTS(Y_MIN))
458
-  #define HAS_Y_MAX (PIN_EXISTS(Y_MAX))
459
-  #define HAS_Z_MIN (PIN_EXISTS(Z_MIN))
460
-  #define HAS_Z_MAX (PIN_EXISTS(Z_MAX))
457
+  #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN))
458
+  #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN))
459
+  #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN))
460
+  #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN))
461
+  #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN))
462
+  #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN))
461
   #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
463
   #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
462
   #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
464
   #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
463
   #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))
465
   #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))

Loading…
Cancel
Save