diff --git a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h index 6ee1f116599e3..9ca1fb9555e03 100644 --- a/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h +++ b/Marlin/src/pins/lpc1768/pins_RAMPS_RE_ARM.h @@ -124,30 +124,18 @@ #ifndef X_SERIAL_TX_PIN #define X_SERIAL_TX_PIN P0_01 #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - #endif #ifndef Y_SERIAL_TX_PIN #define Y_SERIAL_TX_PIN P0_00 #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #endif #ifndef Z_SERIAL_TX_PIN #define Z_SERIAL_TX_PIN P2_13 #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - #endif #ifndef E0_SERIAL_TX_PIN #define E0_SERIAL_TX_PIN P2_08 #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #endif // Reduce baud rate to improve software serial reliability #ifndef TMC_BAUD_RATE diff --git a/Marlin/src/pins/pins_postprocess.h b/Marlin/src/pins/pins_postprocess.h index f9814b45d14b5..90a8e58b5d199 100644 --- a/Marlin/src/pins/pins_postprocess.h +++ b/Marlin/src/pins/pins_postprocess.h @@ -307,74 +307,130 @@ #define E7_CS_PIN -1 #endif +#if HAS_TMC_UART + #if !defined(X_SERIAL_TX_PIN) && PIN_EXISTS(X_SERIAL_RX) + #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN + #endif + #if !defined(X2_SERIAL_TX_PIN) && PIN_EXISTS(X2_SERIAL_RX) + #define X2_SERIAL_RX_PIN X2_SERIAL_TX_PIN + #endif + #if !defined(Y_SERIAL_TX_PIN) && PIN_EXISTS(Y_SERIAL_RX) + #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN + #endif + #if !defined(Y2_SERIAL_TX_PIN) && PIN_EXISTS(Y2_SERIAL_RX) + #define Y2_SERIAL_RX_PIN Y2_SERIAL_TX_PIN + #endif + #if !defined(Z_SERIAL_TX_PIN) && PIN_EXISTS(Z_SERIAL_RX) + #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN + #endif + #if !defined(Z2_SERIAL_TX_PIN) && PIN_EXISTS(Z2_SERIAL_RX) + #define Z2_SERIAL_RX_PIN Z2_SERIAL_TX_PIN + #endif + #if !defined(Z3_SERIAL_TX_PIN) && PIN_EXISTS(Z3_SERIAL_RX) + #define Z3_SERIAL_RX_PIN Z3_SERIAL_TX_PIN + #endif + #if !defined(Z4_SERIAL_TX_PIN) && PIN_EXISTS(Z4_SERIAL_RX) + #define Z4_SERIAL_RX_PIN Z4_SERIAL_TX_PIN + #endif + #if !defined(EX_SERIAL_TX_PIN) && PIN_EXISTS(EX_SERIAL_RX) + #define EX_SERIAL_RX_PIN EX_SERIAL_TX_PIN + #endif + #if !defined(E0_SERIAL_TX_PIN) && PIN_EXISTS(E0_SERIAL_RX) + #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN + #endif + #if !defined(E1_SERIAL_TX_PIN) && PIN_EXISTS(E1_SERIAL_RX) + #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN + #endif + #if !defined(E2_SERIAL_TX_PIN) && PIN_EXISTS(E2_SERIAL_RX) + #define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN + #endif + #if !defined(E3_SERIAL_TX_PIN) && PIN_EXISTS(E3_SERIAL_RX) + #define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN + #endif + #if !defined(E4_SERIAL_TX_PIN) && PIN_EXISTS(E4_SERIAL_RX) + #define E4_SERIAL_RX_PIN E4_SERIAL_TX_PIN + #endif + #if !defined(E5_SERIAL_TX_PIN) && PIN_EXISTS(E5_SERIAL_RX) + #define E5_SERIAL_RX_PIN E5_SERIAL_TX_PIN + #endif + #if !defined(E6_SERIAL_TX_PIN) && PIN_EXISTS(E6_SERIAL_RX) + #define E6_SERIAL_RX_PIN E6_SERIAL_TX_PIN + #endif + #if !defined(E7_SERIAL_TX_PIN) && PIN_EXISTS(E7_SERIAL_RX) + #define E7_SERIAL_RX_PIN E7_SERIAL_TX_PIN + #endif +#endif + // // Destroy stepper driver RX and TX pins when set to -1 +// Some RX depend on TX, so RX needs to be un-defined before TX +// or it breaks "PIN_EXISTS(NAMED_THING)". // -#if !PIN_EXISTS(Z2_SERIAL_TX) - #undef Z2_SERIAL_TX_PIN -#endif -#if !PIN_EXISTS(Z2_SERIAL_RX) - #undef Z2_SERIAL_RX_PIN +#if !PIN_EXISTS(W_SERIAL_RX) + #undef W_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(Z3_SERIAL_TX) - #undef Z3_SERIAL_TX_PIN +#if !PIN_EXISTS(W_SERIAL_TX) + #undef W_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(Z3_SERIAL_RX) - #undef Z3_SERIAL_RX_PIN +#if !PIN_EXISTS(V_SERIAL_RX) + #undef V_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(Z4_SERIAL_TX) - #undef Z4_SERIAL_TX_PIN +#if !PIN_EXISTS(V_SERIAL_TX) + #undef V_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(Z4_SERIAL_RX) - #undef Z4_SERIAL_RX_PIN +#if !PIN_EXISTS(U_SERIAL_RX) + #undef U_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(X2_SERIAL_TX) - #undef X2_SERIAL_TX_PIN +#if !PIN_EXISTS(U_SERIAL_TX) + #undef U_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(X2_SERIAL_RX) - #undef X2_SERIAL_RX_PIN +#if !PIN_EXISTS(K_SERIAL_RX) + #undef K_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(Y2_SERIAL_TX) - #undef Y2_SERIAL_TX_PIN +#if !PIN_EXISTS(K_SERIAL_TX) + #undef K_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(Y2_SERIAL_RX) - #undef Y2_SERIAL_RX_PIN +#if !PIN_EXISTS(J_SERIAL_RX) + #undef J_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(I_SERIAL_TX) - #undef I_SERIAL_TX_PIN +#if !PIN_EXISTS(J_SERIAL_TX) + #undef J_SERIAL_TX_PIN #endif #if !PIN_EXISTS(I_SERIAL_RX) #undef I_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(J_SERIAL_TX) - #undef J_SERIAL_TX_PIN +#if !PIN_EXISTS(I_SERIAL_TX) + #undef I_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(J_SERIAL_RX) - #undef J_SERIAL_RX_PIN +#if !PIN_EXISTS(Z4_SERIAL_RX) + #undef Z4_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(K_SERIAL_TX) - #undef K_SERIAL_TX_PIN +#if !PIN_EXISTS(Z4_SERIAL_TX) + #undef Z4_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(K_SERIAL_RX) - #undef K_SERIAL_RX_PIN +#if !PIN_EXISTS(Z3_SERIAL_RX) + #undef Z3_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(U_SERIAL_TX) - #undef U_SERIAL_TX_PIN +#if !PIN_EXISTS(Z3_SERIAL_TX) + #undef Z3_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(U_SERIAL_RX) - #undef U_SERIAL_RX_PIN +#if !PIN_EXISTS(Z2_SERIAL_RX) + #undef Z2_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(V_SERIAL_TX) - #undef V_SERIAL_TX_PIN +#if !PIN_EXISTS(Z2_SERIAL_TX) + #undef Z2_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(V_SERIAL_RX) - #undef V_SERIAL_RX_PIN +#if !PIN_EXISTS(Y2_SERIAL_RX) + #undef Y2_SERIAL_RX_PIN #endif -#if !PIN_EXISTS(W_SERIAL_TX) - #undef W_SERIAL_TX_PIN +#if !PIN_EXISTS(Y2_SERIAL_TX) + #undef Y2_SERIAL_TX_PIN #endif -#if !PIN_EXISTS(W_SERIAL_RX) - #undef W_SERIAL_RX_PIN +#if !PIN_EXISTS(X2_SERIAL_RX) + #undef X2_SERIAL_RX_PIN +#endif +#if !PIN_EXISTS(X2_SERIAL_TX) + #undef X2_SERIAL_TX_PIN #endif #ifndef FAN0_PIN diff --git a/Marlin/src/pins/samd/pins_RAMPS_144.h b/Marlin/src/pins/samd/pins_RAMPS_144.h index 6897540f05e87..33a45fc9f4e85 100644 --- a/Marlin/src/pins/samd/pins_RAMPS_144.h +++ b/Marlin/src/pins/samd/pins_RAMPS_144.h @@ -210,54 +210,30 @@ #ifndef X_SERIAL_TX_PIN #define X_SERIAL_TX_PIN 47 #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - #endif #ifndef X2_SERIAL_TX_PIN #define X2_SERIAL_TX_PIN -1 #endif - #ifndef X2_SERIAL_RX_PIN - #define X2_SERIAL_RX_PIN X2_SERIAL_TX_PIN - #endif #ifndef Y_SERIAL_TX_PIN #define Y_SERIAL_TX_PIN 45 #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #endif #ifndef Y2_SERIAL_TX_PIN #define Y2_SERIAL_TX_PIN -1 #endif - #ifndef Y2_SERIAL_RX_PIN - #define Y2_SERIAL_RX_PIN Y2_SERIAL_TX_PIN - #endif #ifndef Z_SERIAL_TX_PIN #define Z_SERIAL_TX_PIN 32 #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - #endif #ifndef Z2_SERIAL_TX_PIN #define Z2_SERIAL_TX_PIN 22 #endif - #ifndef Z2_SERIAL_RX_PIN - #define Z2_SERIAL_RX_PIN Z2_SERIAL_TX_PIN - #endif #ifndef E0_SERIAL_TX_PIN #define E0_SERIAL_TX_PIN 43 #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #endif #ifndef E1_SERIAL_TX_PIN #define E1_SERIAL_TX_PIN -1 #endif - #ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN - #endif #endif // diff --git a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h index 5eb398c3cf696..3da978c06f00e 100644 --- a/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h +++ b/Marlin/src/pins/stm32f4/pins_FYSETC_CHEETAH_V30.h @@ -94,29 +94,17 @@ #ifndef X_SERIAL_TX_PIN #define X_SERIAL_TX_PIN PB3 #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - #endif #ifndef Y_SERIAL_TX_PIN #define Y_SERIAL_TX_PIN PB3 #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #endif #ifndef Z_SERIAL_TX_PIN #define Z_SERIAL_TX_PIN PB3 #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - #endif #ifndef E0_SERIAL_TX_PIN #define E0_SERIAL_TX_PIN PB3 #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #endif // Default TMC slave addresses #ifndef X_SLAVE_ADDRESS diff --git a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h index 879c318f8575a..f29d4ba2d5024 100644 --- a/Marlin/src/pins/stm32f4/pins_LERDGE_K.h +++ b/Marlin/src/pins/stm32f4/pins_LERDGE_K.h @@ -120,40 +120,22 @@ #ifndef X_SERIAL_TX_PIN #define X_SERIAL_TX_PIN PB2 #endif - #ifndef X_SERIAL_RX_PIN - #define X_SERIAL_RX_PIN X_SERIAL_TX_PIN - #endif #ifndef Y_SERIAL_TX_PIN #define Y_SERIAL_TX_PIN PE2 #endif - #ifndef Y_SERIAL_RX_PIN - #define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN - #endif #ifndef Z_SERIAL_TX_PIN #define Z_SERIAL_TX_PIN PE3 #endif - #ifndef Z_SERIAL_RX_PIN - #define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN - #endif #ifndef E0_SERIAL_TX_PIN #define E0_SERIAL_TX_PIN PE4 #endif - #ifndef E0_SERIAL_RX_PIN - #define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN - #endif #ifndef E1_SERIAL_TX_PIN #define E1_SERIAL_TX_PIN PE1 #endif - #ifndef E1_SERIAL_RX_PIN - #define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN - #endif // Ex-motor can be any... X2/Y2/Z2 or E2 #ifndef EX_SERIAL_TX_PIN #define EX_SERIAL_TX_PIN PE0 #endif - #ifndef EX_SERIAL_RX_PIN - #define EX_SERIAL_RX_PIN EX_SERIAL_TX_PIN - #endif //#define Z2_SERIAL_RX_PIN EX_SERIAL_RX_PIN //#define Z2_SERIAL_TX_PIN EX_SERIAL_TX_PIN //#define E2_SERIAL_RX_PIN EX_SERIAL_RX_PIN