|
|
@ -318,6 +318,7 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|
|
|
enum TMCAxis : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7, TOTAL };
|
|
|
|
enum TMCAxis : uint8_t { X, Y, Z, X2, Y2, Z2, Z3, Z4, E0, E1, E2, E3, E4, E5, E6, E7, TOTAL };
|
|
|
|
|
|
|
|
|
|
|
|
void tmc_serial_begin() {
|
|
|
|
void tmc_serial_begin() {
|
|
|
|
|
|
|
|
#if HAS_TMC_HW_SERIAL
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
const void *ptr[TMCAxis::TOTAL];
|
|
|
|
const void *ptr[TMCAxis::TOTAL];
|
|
|
|
bool began(const TMCAxis a, const void * const p) {
|
|
|
|
bool began(const TMCAxis a, const void * const p) {
|
|
|
@ -325,8 +326,11 @@ enum StealthIndex : uint8_t { STEALTH_AXIS_XY, STEALTH_AXIS_Z, STEALTH_AXIS_E };
|
|
|
|
ptr[a] = p; return false;
|
|
|
|
ptr[a] = p; return false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
} sp_helper;
|
|
|
|
} sp_helper;
|
|
|
|
|
|
|
|
|
|
|
|
#define HW_SERIAL_BEGIN(A) do{ if (!sp_helper.began(TMCAxis::A, &A##_HARDWARE_SERIAL)) \
|
|
|
|
#define HW_SERIAL_BEGIN(A) do{ if (!sp_helper.began(TMCAxis::A, &A##_HARDWARE_SERIAL)) \
|
|
|
|
A##_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); }while(0)
|
|
|
|
A##_HARDWARE_SERIAL.begin(TMC_BAUD_RATE); }while(0)
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if AXIS_HAS_UART(X)
|
|
|
|
#if AXIS_HAS_UART(X)
|
|
|
|
#ifdef X_HARDWARE_SERIAL
|
|
|
|
#ifdef X_HARDWARE_SERIAL
|
|
|
|
HW_SERIAL_BEGIN(X);
|
|
|
|
HW_SERIAL_BEGIN(X);
|
|
|
|