|
|
|
@ -2157,69 +2157,58 @@ static_assert(Y_MAX_LENGTH >= Y_BED_SIZE, "Movement bounds (Y_MIN_POS, Y_MAX_POS
|
|
|
|
|
#error "STEALTHCHOP requires TMC2130, TMC2160, TMC2208, TMC2209, or TMC5160 stepper drivers."
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if TMC_USE_CHAIN
|
|
|
|
|
#if (X_CHAIN_POS && !PIN_EXISTS(X_CS) ) \
|
|
|
|
|
|| (Y_CHAIN_POS && !PIN_EXISTS(Y_CS) ) \
|
|
|
|
|
|| (Z_CHAIN_POS && !PIN_EXISTS(Z_CS) ) \
|
|
|
|
|
|| (X2_CHAIN_POS && !PIN_EXISTS(X2_CS)) \
|
|
|
|
|
|| (Y2_CHAIN_POS && !PIN_EXISTS(Y2_CS)) \
|
|
|
|
|
|| (Z2_CHAIN_POS && !PIN_EXISTS(Z2_CS)) \
|
|
|
|
|
|| (Z3_CHAIN_POS && !PIN_EXISTS(Z3_CS)) \
|
|
|
|
|
|| (E0_CHAIN_POS && !PIN_EXISTS(E0_CS)) \
|
|
|
|
|
|| (E1_CHAIN_POS && !PIN_EXISTS(E1_CS)) \
|
|
|
|
|
|| (E2_CHAIN_POS && !PIN_EXISTS(E2_CS)) \
|
|
|
|
|
|| (E3_CHAIN_POS && !PIN_EXISTS(E3_CS)) \
|
|
|
|
|
|| (E4_CHAIN_POS && !PIN_EXISTS(E4_CS)) \
|
|
|
|
|
|| (E5_CHAIN_POS && !PIN_EXISTS(E5_CS))
|
|
|
|
|
#error "With TMC_USE_CHAIN all chained TMC drivers need a CS pin."
|
|
|
|
|
#define IN_CHAIN(A) (A##_CHAIN_POS > 0)
|
|
|
|
|
// TMC SPI Chaining
|
|
|
|
|
#if IN_CHAIN(X) || IN_CHAIN(Y) || IN_CHAIN(Z) || IN_CHAIN(X2) || IN_CHAIN(Y2) || IN_CHAIN(Z2) || IN_CHAIN(Z3) || IN_CHAIN(E0) || IN_CHAIN(E1) || IN_CHAIN(E2) || IN_CHAIN(E3) || IN_CHAIN(E4) || IN_CHAIN(E5)
|
|
|
|
|
#if (IN_CHAIN(X) && !PIN_EXISTS(X_CS) ) || (IN_CHAIN(Y) && !PIN_EXISTS(Y_CS) ) \
|
|
|
|
|
|| (IN_CHAIN(Z) && !PIN_EXISTS(Z_CS) ) || (IN_CHAIN(X2) && !PIN_EXISTS(X2_CS)) \
|
|
|
|
|
|| (IN_CHAIN(Y2) && !PIN_EXISTS(Y2_CS)) || (IN_CHAIN(Z2) && !PIN_EXISTS(Z2_CS)) \
|
|
|
|
|
|| (IN_CHAIN(Z3) && !PIN_EXISTS(Z3_CS)) || (IN_CHAIN(E0) && !PIN_EXISTS(E0_CS)) \
|
|
|
|
|
|| (IN_CHAIN(E1) && !PIN_EXISTS(E1_CS)) || (IN_CHAIN(E2) && !PIN_EXISTS(E2_CS)) \
|
|
|
|
|
|| (IN_CHAIN(E3) && !PIN_EXISTS(E3_CS)) || (IN_CHAIN(E4) && !PIN_EXISTS(E4_CS)) \
|
|
|
|
|
|| (IN_CHAIN(E5) && !PIN_EXISTS(E5_CS))
|
|
|
|
|
#error "All chained TMC drivers need a CS pin."
|
|
|
|
|
#else
|
|
|
|
|
#if X_CHAIN_POS
|
|
|
|
|
#if IN_CHAIN(X)
|
|
|
|
|
#define CS_COMPARE X_CS_PIN
|
|
|
|
|
#elif Y_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(Y)
|
|
|
|
|
#define CS_COMPARE Y_CS_PIN
|
|
|
|
|
#elif Z_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(Z)
|
|
|
|
|
#define CS_COMPARE Z_CS_PIN
|
|
|
|
|
#elif X2_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(X2)
|
|
|
|
|
#define CS_COMPARE X2_CS_PIN
|
|
|
|
|
#elif Y2_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(Y2)
|
|
|
|
|
#define CS_COMPARE Y2_CS_PIN
|
|
|
|
|
#elif Z2_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(Z2)
|
|
|
|
|
#define CS_COMPARE Z2_CS_PIN
|
|
|
|
|
#elif Z3_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(Z3)
|
|
|
|
|
#define CS_COMPARE Z3_CS_PIN
|
|
|
|
|
#elif E0_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E0)
|
|
|
|
|
#define CS_COMPARE E0_CS_PIN
|
|
|
|
|
#elif E1_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E1)
|
|
|
|
|
#define CS_COMPARE E1_CS_PIN
|
|
|
|
|
#elif E2_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E2)
|
|
|
|
|
#define CS_COMPARE E2_CS_PIN
|
|
|
|
|
#elif E3_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E3)
|
|
|
|
|
#define CS_COMPARE E3_CS_PIN
|
|
|
|
|
#elif E4_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E4)
|
|
|
|
|
#define CS_COMPARE E4_CS_PIN
|
|
|
|
|
#elif E5_CHAIN_POS
|
|
|
|
|
#elif IN_CHAIN(E5)
|
|
|
|
|
#define CS_COMPARE E5_CS_PIN
|
|
|
|
|
#else
|
|
|
|
|
#error "With TMC_USE_CHAIN some TMC drivers should be chained."
|
|
|
|
|
#endif
|
|
|
|
|
#if (X_CHAIN_POS && X_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (Y_CHAIN_POS && Y_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (Z_CHAIN_POS && Z_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (X2_CHAIN_POS && X2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (Y2_CHAIN_POS && Y2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (Z2_CHAIN_POS && Z2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (Z3_CHAIN_POS && Z3_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E0_CHAIN_POS && E0_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E1_CHAIN_POS && E1_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E2_CHAIN_POS && E2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E3_CHAIN_POS && E3_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E4_CHAIN_POS && E4_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (E5_CHAIN_POS && E5_CS_PIN != CS_COMPARE)
|
|
|
|
|
#error "With TMC_USE_CHAIN all TMC drivers must use the same CS pin."
|
|
|
|
|
#if (IN_CHAIN(X) && X_CS_PIN != CS_COMPARE) || (IN_CHAIN(Y) && Y_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(Z) && Z_CS_PIN != CS_COMPARE) || (IN_CHAIN(X2) && X2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(Y2) && Y2_CS_PIN != CS_COMPARE) || (IN_CHAIN(Z2) && Z2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(Z3) && Z3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E0) && E0_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(E1) && E1_CS_PIN != CS_COMPARE) || (IN_CHAIN(E2) && E2_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(E3) && E3_CS_PIN != CS_COMPARE) || (IN_CHAIN(E4) && E4_CS_PIN != CS_COMPARE) \
|
|
|
|
|
|| (IN_CHAIN(E5) && E5_CS_PIN != CS_COMPARE)
|
|
|
|
|
#error "All chained TMC drivers must use the same CS pin."
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
#undef CS_COMPARE
|
|
|
|
|
#endif // TMC_USE_CHAIN
|
|
|
|
|
#endif
|
|
|
|
|
#undef IN_CHAIN
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA) && (ENABLED(STEALTHCHOP_XY) != ENABLED(STEALTHCHOP_Z))
|
|
|
|
|
#error "STEALTHCHOP_XY and STEALTHCHOP_Z must be the same on DELTA."
|
|
|
|
|