Sfoglia il codice sorgente

Fix Conditionals test for endstop plug used by Z2 or probe.

Bob-the-Kuhn 7 anni fa
parent
commit
7ce613db0a
1 ha cambiato i file con 10 aggiunte e 9 eliminazioni
  1. 10
    9
      Marlin/Conditionals_post.h

+ 10
- 9
Marlin/Conditionals_post.h Vedi File

@@ -413,9 +413,10 @@
413 413
     #endif
414 414
   #endif
415 415
 
416
-  #define IS_Z2_OR_PROBE(P) (   (PIN_EXISTS(Z2_MIN)      && (P) == Z2_MIN_PIN)       \
417
-                             || (PIN_EXISTS(Z2_MAX)      && (P) == Z2_MAX_PIN)       \
418
-                             || (PIN_EXISTS(Z_MIN_PROBE) && (P) == Z_MIN_PROBE_PIN))
416
+  // Is an endstop plug used for the Z2 endstop or the bed probe?
417
+  #define IS_Z2_OR_PROBE(A,M) ( \
418
+       (ENABLED(Z_DUAL_ENDSTOPS) && Z2_USE_ENDSTOP == _##A##M##_) \
419
+    || (ENABLED(Z_MIN_PROBE_ENDSTOP) && Z_MIN_PROBE_PIN == A##_##M##_PIN ) )
419 420
 
420 421
   /**
421 422
    * Set ENDSTOPPULLUPS for active endstop switches
@@ -505,12 +506,12 @@
505 506
   #define HAS_SOLENOID_4    (PIN_EXISTS(SOL4))
506 507
 
507 508
   // Endstops and bed probe
508
-  #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X_MIN_PIN))
509
-  #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X_MAX_PIN))
510
-  #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y_MIN_PIN))
511
-  #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y_MAX_PIN))
512
-  #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z_MIN_PIN))
513
-  #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z_MAX_PIN))
509
+  #define HAS_X_MIN (PIN_EXISTS(X_MIN) && !IS_Z2_OR_PROBE(X,MIN))
510
+  #define HAS_X_MAX (PIN_EXISTS(X_MAX) && !IS_Z2_OR_PROBE(X,MAX))
511
+  #define HAS_Y_MIN (PIN_EXISTS(Y_MIN) && !IS_Z2_OR_PROBE(Y,MIN))
512
+  #define HAS_Y_MAX (PIN_EXISTS(Y_MAX) && !IS_Z2_OR_PROBE(Y,MAX))
513
+  #define HAS_Z_MIN (PIN_EXISTS(Z_MIN) && !IS_Z2_OR_PROBE(Z,MIN))
514
+  #define HAS_Z_MAX (PIN_EXISTS(Z_MAX) && !IS_Z2_OR_PROBE(Z,MAX))
514 515
   #define HAS_Z2_MIN (PIN_EXISTS(Z2_MIN))
515 516
   #define HAS_Z2_MAX (PIN_EXISTS(Z2_MAX))
516 517
   #define HAS_Z_MIN_PROBE_PIN (PIN_EXISTS(Z_MIN_PROBE))

Loading…
Annulla
Salva