Skip to content

Commit

Permalink
No pin for SPI endstop
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed May 1, 2023
1 parent 269cbc3 commit df8f1f0
Showing 1 changed file with 33 additions and 34 deletions.
67 changes: 33 additions & 34 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -1927,16 +1927,15 @@
#endif
#endif

//
// Endstops and bed probe
//

#define _HAS_STOP(A,N,M,C) ((A##_HOME_TO_##M || (C+0)) && PIN_EXISTS(A##N##_##M))
/**
* Endstop and probe flags
*/
#define _USE_STOP(A,N,M,C) ((A##_HOME_TO_##M || (C+0)) && PIN_EXISTS(A##N##_##M) && !A##_SPI_SENSORLESS)

#if _HAS_STOP(X,,MIN,)
#if _USE_STOP(X,,MIN,)
#define USE_X_MIN 1
#endif
#if _HAS_STOP(X,,MAX,ENABLED(DUAL_X_CARRIAGE))
#if _USE_STOP(X,,MAX,ENABLED(DUAL_X_CARRIAGE))
#define USE_X_MAX 1
#endif
#if USE_X_MIN || BOTH(X_SPI_SENSORLESS, X_HOME_TO_MIN)
Expand All @@ -1949,9 +1948,9 @@
#define HAS_X_STATE 1
#endif

#if _HAS_STOP(Y,,MIN,)
#if _USE_STOP(Y,,MIN,)
#define USE_Y_MIN 1
#elif _HAS_STOP(Y,,MAX,)
#elif _USE_STOP(Y,,MAX,)
#define USE_Y_MAX 1
#endif
#if USE_Y_MIN || BOTH(Y_SPI_SENSORLESS, Y_HOME_TO_MIN)
Expand All @@ -1963,10 +1962,10 @@
#define HAS_Y_STATE 1
#endif

#if _HAS_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#if _USE_STOP(Z,,MIN,ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#define USE_Z_MIN 1
#endif
#if _HAS_STOP(Z,,MAX,)
#if _USE_STOP(Z,,MAX,)
#define USE_Z_MAX 1
#endif
#if USE_Z_MIN || BOTH(Z_SPI_SENSORLESS, Z_HOME_TO_MIN)
Expand All @@ -1979,9 +1978,9 @@
#define HAS_Z_STATE 1
#endif

#if _HAS_STOP(I,,MIN,)
#if _USE_STOP(I,,MIN,)
#define USE_I_MIN 1
#elif _HAS_STOP(I,,MAX,)
#elif _USE_STOP(I,,MAX,)
#define USE_I_MAX 1
#endif
#if USE_I_MIN || BOTH(I_SPI_SENSORLESS, I_HOME_TO_MIN)
Expand All @@ -1993,9 +1992,9 @@
#define HAS_I_STATE 1
#endif

#if _HAS_STOP(J,,MIN,)
#if _USE_STOP(J,,MIN,)
#define USE_J_MIN 1
#elif _HAS_STOP(J,,MAX,)
#elif _USE_STOP(J,,MAX,)
#define USE_J_MAX 1
#endif
#if USE_J_MIN || BOTH(J_SPI_SENSORLESS, J_HOME_TO_MIN)
Expand All @@ -2007,9 +2006,9 @@
#define HAS_J_STATE 1
#endif

#if _HAS_STOP(K,,MIN,)
#if _USE_STOP(K,,MIN,)
#define USE_K_MIN 1
#elif _HAS_STOP(K,,MAX,)
#elif _USE_STOP(K,,MAX,)
#define USE_K_MAX 1
#endif
#if USE_K_MIN || BOTH(K_SPI_SENSORLESS, K_HOME_TO_MIN)
Expand All @@ -2021,9 +2020,9 @@
#define HAS_K_STATE 1
#endif

#if _HAS_STOP(U,,MIN,)
#if _USE_STOP(U,,MIN,)
#define USE_U_MIN 1
#elif _HAS_STOP(U,,MAX,)
#elif _USE_STOP(U,,MAX,)
#define USE_U_MAX 1
#endif
#if USE_U_MIN || BOTH(U_SPI_SENSORLESS, U_HOME_TO_MIN)
Expand All @@ -2035,9 +2034,9 @@
#define HAS_U_STATE 1
#endif

#if _HAS_STOP(V,,MIN,)
#if _USE_STOP(V,,MIN,)
#define USE_V_MIN 1
#elif _HAS_STOP(V,,MAX,)
#elif _USE_STOP(V,,MAX,)
#define USE_V_MAX 1
#endif
#if USE_V_MIN || BOTH(V_SPI_SENSORLESS, V_HOME_TO_MIN)
Expand All @@ -2049,9 +2048,9 @@
#define HAS_V_STATE 1
#endif

#if _HAS_STOP(W,,MIN,)
#if _USE_STOP(W,,MIN,)
#define USE_W_MIN 1
#elif _HAS_STOP(W,,MAX,)
#elif _USE_STOP(W,,MAX,)
#define USE_W_MAX 1
#endif
#if USE_W_MIN || BOTH(W_SPI_SENSORLESS, W_HOME_TO_MIN)
Expand All @@ -2064,9 +2063,9 @@
#endif

#if ENABLED(X_DUAL_ENDSTOPS)
#if _HAS_STOP(X,2,MIN,)
#if _USE_STOP(X,2,MIN,)
#define USE_X2_MIN 1
#elif _HAS_STOP(X,2,MAX,)
#elif _USE_STOP(X,2,MAX,)
#define USE_X2_MAX 1
#endif
#if USE_X2_MIN || HAS_X_MIN_STATE
Expand All @@ -2080,9 +2079,9 @@
#endif

#if ENABLED(Y_DUAL_ENDSTOPS)
#if _HAS_STOP(Y,2,MIN,)
#if _USE_STOP(Y,2,MIN,)
#define USE_Y2_MIN 1
#elif _HAS_STOP(Y,2,MAX,)
#elif _USE_STOP(Y,2,MAX,)
#define USE_Y2_MAX 1
#endif
#if USE_Y2_MIN || HAS_Y_MIN_STATE
Expand All @@ -2096,9 +2095,9 @@
#endif

#if ENABLED(Z_MULTI_ENDSTOPS)
#if _HAS_STOP(Z,2,MIN,)
#if _USE_STOP(Z,2,MIN,)
#define USE_Z2_MIN 1
#elif _HAS_STOP(Z,2,MAX,)
#elif _USE_STOP(Z,2,MAX,)
#define USE_Z2_MAX 1
#endif
#if USE_Z2_MIN || HAS_Z_MIN_STATE
Expand All @@ -2110,9 +2109,9 @@
#define HAS_Z2_STATE 1
#endif
#if NUM_Z_STEPPERS >= 3
#if _HAS_STOP(Z,3,MIN,)
#if _USE_STOP(Z,3,MIN,)
#define USE_Z3_MIN 1
#elif _HAS_STOP(Z,3,MAX,)
#elif _USE_STOP(Z,3,MAX,)
#define USE_Z3_MAX 1
#endif
#if USE_Z3_MIN || HAS_Z_MIN_STATE
Expand All @@ -2125,9 +2124,9 @@
#endif
#endif
#if NUM_Z_STEPPERS >= 4
#if _HAS_STOP(Z,4,MIN,)
#if _USE_STOP(Z,4,MIN,)
#define USE_Z4_MIN 1
#elif _HAS_STOP(Z,4,MAX,)
#elif _USE_STOP(Z,4,MAX,)
#define USE_Z4_MAX 1
#endif
#if USE_Z4_MIN || HAS_Z_MIN_STATE
Expand All @@ -2148,7 +2147,7 @@
#define HAS_Z_PROBE_STATE 1
#endif

#undef _HAS_STOP
#undef _USE_STOP

/**
* Set ENDSTOPPULLUPS for active endstop switches
Expand Down

0 comments on commit df8f1f0

Please sign in to comment.