Only assign CS/RX/TX on extra axes with SPI/UART (#15886)

This commit is contained in:
Robby Candra 2019-11-13 15:03:34 +07:00 committed by Scott Lahteine
parent a4709ba765
commit fcfde7c2f5

View file

@ -987,9 +987,6 @@
#error "No E stepper plug left for X2!" #error "No E stepper plug left for X2!"
#endif #endif
#endif #endif
#ifndef X2_CS_PIN
#define X2_CS_PIN _EPIN(E_STEPPERS, CS)
#endif
#ifndef X2_MS1_PIN #ifndef X2_MS1_PIN
#define X2_MS1_PIN _EPIN(E_STEPPERS, MS1) #define X2_MS1_PIN _EPIN(E_STEPPERS, MS1)
#endif #endif
@ -999,7 +996,10 @@
#ifndef X2_MS3_PIN #ifndef X2_MS3_PIN
#define X2_MS3_PIN _EPIN(E_STEPPERS, MS3) #define X2_MS3_PIN _EPIN(E_STEPPERS, MS3)
#endif #endif
#if AXIS_DRIVER_TYPE_X2(TMC2208) || AXIS_DRIVER_TYPE_X2(TMC2209) #if AXIS_HAS_SPI(X2) && !defined(X2_CS_PIN)
#define X2_CS_PIN _EPIN(E_STEPPERS, CS)
#endif
#if AXIS_HAS_UART(X2)
#ifndef X2_SERIAL_TX_PIN #ifndef X2_SERIAL_TX_PIN
#define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX) #define X2_SERIAL_TX_PIN _EPIN(E_STEPPERS, SERIAL_TX)
#endif #endif
@ -1035,9 +1035,6 @@
#error "No E stepper plug left for Y2!" #error "No E stepper plug left for Y2!"
#endif #endif
#endif #endif
#ifndef Y2_CS_PIN
#define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS)
#endif
#ifndef Y2_MS1_PIN #ifndef Y2_MS1_PIN
#define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1) #define Y2_MS1_PIN _EPIN(Y2_E_INDEX, MS1)
#endif #endif
@ -1047,7 +1044,10 @@
#ifndef Y2_MS3_PIN #ifndef Y2_MS3_PIN
#define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3) #define Y2_MS3_PIN _EPIN(Y2_E_INDEX, MS3)
#endif #endif
#if AXIS_DRIVER_TYPE_Y2(TMC2208) || AXIS_DRIVER_TYPE_Y2(TMC2209) #if AXIS_HAS_SPI(Y2) && !defined(Y2_CS_PIN)
#define Y2_CS_PIN _EPIN(Y2_E_INDEX, CS)
#endif
#if AXIS_HAS_UART(Y2)
#ifndef Y2_SERIAL_TX_PIN #ifndef Y2_SERIAL_TX_PIN
#define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX) #define Y2_SERIAL_TX_PIN _EPIN(Y2_E_INDEX, SERIAL_TX)
#endif #endif
@ -1083,9 +1083,6 @@
#error "No E stepper plug left for Z2!" #error "No E stepper plug left for Z2!"
#endif #endif
#endif #endif
#ifndef Z2_CS_PIN
#define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS)
#endif
#ifndef Z2_MS1_PIN #ifndef Z2_MS1_PIN
#define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1) #define Z2_MS1_PIN _EPIN(Z2_E_INDEX, MS1)
#endif #endif
@ -1095,7 +1092,10 @@
#ifndef Z2_MS3_PIN #ifndef Z2_MS3_PIN
#define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3) #define Z2_MS3_PIN _EPIN(Z2_E_INDEX, MS3)
#endif #endif
#if AXIS_DRIVER_TYPE_Z2(TMC2208) || AXIS_DRIVER_TYPE_Z2(TMC2209) #if AXIS_HAS_SPI(Z2) && !defined(Z2_CS_PIN)
#define Z2_CS_PIN _EPIN(Z2_E_INDEX, CS)
#endif
#if AXIS_HAS_UART(Z2)
#ifndef Z2_SERIAL_TX_PIN #ifndef Z2_SERIAL_TX_PIN
#define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX) #define Z2_SERIAL_TX_PIN _EPIN(Z2_E_INDEX, SERIAL_TX)
#endif #endif
@ -1130,9 +1130,11 @@
#error "No E stepper plug left for Z3!" #error "No E stepper plug left for Z3!"
#endif #endif
#endif #endif
#if AXIS_HAS_SPI(Z3)
#ifndef Z3_CS_PIN #ifndef Z3_CS_PIN
#define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS) #define Z3_CS_PIN _EPIN(Z3_E_INDEX, CS)
#endif #endif
#endif
#ifndef Z3_MS1_PIN #ifndef Z3_MS1_PIN
#define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1) #define Z3_MS1_PIN _EPIN(Z3_E_INDEX, MS1)
#endif #endif
@ -1142,7 +1144,7 @@
#ifndef Z3_MS3_PIN #ifndef Z3_MS3_PIN
#define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3) #define Z3_MS3_PIN _EPIN(Z3_E_INDEX, MS3)
#endif #endif
#if AXIS_DRIVER_TYPE_Z3(TMC2208) || AXIS_DRIVER_TYPE_Z3(TMC2209) #if AXIS_HAS_UART(Z3)
#ifndef Z3_SERIAL_TX_PIN #ifndef Z3_SERIAL_TX_PIN
#define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX) #define Z3_SERIAL_TX_PIN _EPIN(Z3_E_INDEX, SERIAL_TX)
#endif #endif