diff --git a/Grbl_Esp32/grbl_trinamic.cpp b/Grbl_Esp32/grbl_trinamic.cpp index ee46a836..0bdd8be1 100644 --- a/Grbl_Esp32/grbl_trinamic.cpp +++ b/Grbl_Esp32/grbl_trinamic.cpp @@ -20,12 +20,16 @@ along with Grbl. If not, see . */ +#ifdef USE_TRINAMIC + #include "grbl.h" // TODO try to use the #define ## method to clean this up //#define DRIVER(driver, axis) driver##Stepper = TRINAMIC_axis## = driver##Stepper(axis##_CS_PIN, axis##_RSENSE); + + #ifdef X_TRINAMIC #ifdef X_DRIVER_TMC2130 TMC2130Stepper TRINAMIC_X = TMC2130Stepper(X_CS_PIN, X_RSENSE); @@ -169,4 +173,6 @@ void Trinamic_Init() #endif // TODO ABC Axes -} \ No newline at end of file +} + +#endif \ No newline at end of file diff --git a/Grbl_Esp32/stepper.h b/Grbl_Esp32/stepper.h index aeeb1beb..b1625acf 100644 --- a/Grbl_Esp32/stepper.h +++ b/Grbl_Esp32/stepper.h @@ -82,8 +82,10 @@ extern uint8_t ganged_mode; void IRAM_ATTR onSteppertimer(); void IRAM_ATTR onStepperOffTimer(); +#ifdef USE_RMT_STEPS void initRMT(); inline IRAM_ATTR static void stepperRMT_Outputs(); +#endif void stepper_init();