Sfoglia il codice sorgente

Fix Z homing with custom probe pins (#18150)

Jonathan Gilbert 5 anni fa
parent
commit
e380498512
Nessun account collegato all'indirizzo email del committer
1 ha cambiato i file con 7 aggiunte e 18 eliminazioni
  1. 7
    18
      Marlin/src/module/motion.cpp

+ 7
- 18
Marlin/src/module/motion.cpp Vedi File

@@ -1534,24 +1534,13 @@ void homeaxis(const AxisEnum axis) {
1534 1534
     // Only Z homing (with probe) is permitted
1535 1535
     if (axis != Z_AXIS) { BUZZ(100, 880); return; }
1536 1536
   #else
1537
-    #define _CAN_HOME(A) \
1538
-      (axis == _AXIS(A) && ((A##_MIN_PIN > -1 && A##_HOME_DIR < 0) || (A##_MAX_PIN > -1 && A##_HOME_DIR > 0)))
1539
-    #if X_SPI_SENSORLESS
1540
-      #define CAN_HOME_X true
1541
-    #else
1542
-      #define CAN_HOME_X _CAN_HOME(X)
1543
-    #endif
1544
-    #if Y_SPI_SENSORLESS
1545
-      #define CAN_HOME_Y true
1546
-    #else
1547
-      #define CAN_HOME_Y _CAN_HOME(Y)
1548
-    #endif
1549
-    #if Z_SPI_SENSORLESS
1550
-      #define CAN_HOME_Z true
1551
-    #else
1552
-      #define CAN_HOME_Z _CAN_HOME(Z)
1553
-    #endif
1554
-    if (!CAN_HOME_X && !CAN_HOME_Y && !CAN_HOME_Z) return;
1537
+    #define _CAN_HOME(A) (axis == _AXIS(A) && ( \
1538
+         ENABLED(A##_SPI_SENSORLESS) \
1539
+      || (_AXIS(A) == Z_AXIS && ENABLED(HOMING_Z_WITH_PROBE)) \
1540
+      || (A##_MIN_PIN > 0 && A##_HOME_DIR < 0) \
1541
+      || (A##_MAX_PIN > 0 && A##_HOME_DIR > 0) \
1542
+    ))
1543
+    if (!_CAN_HOME(X) && !_CAN_HOME(Y) && !_CAN_HOME(Z)) return;
1555 1544
   #endif
1556 1545
 
1557 1546
   if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR(">>> homeaxis(", axis_codes[axis], ")");

Loading…
Annulla
Salva