From a894ddb0f58a81de5f2d7c5670e75d7dcc8c6432 Mon Sep 17 00:00:00 2001 From: bdring Date: Tue, 1 Oct 2019 09:33:31 -0500 Subject: [PATCH 1/3] Added TMCStepper Lib Version to startup message - Startup message will look something like this. [MSG:Using TMCStepper Library Ver 0x000500] to help with user support --- Grbl_Esp32/grbl.h | 2 +- Grbl_Esp32/grbl_trinamic.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Grbl_Esp32/grbl.h b/Grbl_Esp32/grbl.h index 5dc3e42a..5fd7ed4a 100644 --- a/Grbl_Esp32/grbl.h +++ b/Grbl_Esp32/grbl.h @@ -20,7 +20,7 @@ // Grbl versioning system #define GRBL_VERSION "1.1f" -#define GRBL_VERSION_BUILD "20190928" +#define GRBL_VERSION_BUILD "20191001" //#include #include diff --git a/Grbl_Esp32/grbl_trinamic.cpp b/Grbl_Esp32/grbl_trinamic.cpp index 9f820ad6..ee46a836 100644 --- a/Grbl_Esp32/grbl_trinamic.cpp +++ b/Grbl_Esp32/grbl_trinamic.cpp @@ -102,7 +102,7 @@ void Trinamic_Init() { - grbl_send(CLIENT_SERIAL, "[MSG:Using TMCStepper Library]\r\n"); + grbl_sendf(CLIENT_SERIAL, "[MSG:Using TMCStepper Library Ver 0x%06x]\r\n", TMCSTEPPER_VERSION); SPI.begin(); From 4a24a54b0a69f9776c5e3c4904673770d041c05d Mon Sep 17 00:00:00 2001 From: bdring Date: Tue, 1 Oct 2019 10:05:25 -0500 Subject: [PATCH 2/3] Fixed some compile issues --- Grbl_Esp32/grbl_trinamic.cpp | 8 +++++++- Grbl_Esp32/stepper.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) 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(); From 414ce3528b5e242822052cbc4dee47a4fb30c69d Mon Sep 17 00:00:00 2001 From: bdring Date: Tue, 1 Oct 2019 11:14:02 -0500 Subject: [PATCH 3/3] Fixing more comiple issues with non default setups --- Grbl_Esp32/grbl.h | 3 +-- Grbl_Esp32/grbl_trinamic.cpp | 6 +----- Grbl_Esp32/grbl_trinamic.h | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Grbl_Esp32/grbl.h b/Grbl_Esp32/grbl.h index 5fd7ed4a..6a694fdf 100644 --- a/Grbl_Esp32/grbl.h +++ b/Grbl_Esp32/grbl.h @@ -86,7 +86,6 @@ #endif #ifdef USE_TRINAMIC - #include "grbl_trinamic.h" - //#include "TMCStepper.h" // https://github.com/teemuatlut/TMCStepper + #include "grbl_trinamic.h" #endif diff --git a/Grbl_Esp32/grbl_trinamic.cpp b/Grbl_Esp32/grbl_trinamic.cpp index 0bdd8be1..a431ca3e 100644 --- a/Grbl_Esp32/grbl_trinamic.cpp +++ b/Grbl_Esp32/grbl_trinamic.cpp @@ -19,17 +19,13 @@ You should have received a copy of the GNU General Public License along with Grbl. If not, see . */ +#include "grbl.h" #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); diff --git a/Grbl_Esp32/grbl_trinamic.h b/Grbl_Esp32/grbl_trinamic.h index d5360704..92239f49 100644 --- a/Grbl_Esp32/grbl_trinamic.h +++ b/Grbl_Esp32/grbl_trinamic.h @@ -22,9 +22,9 @@ #define GRBL_TRINAMIC_h #include "grbl.h" -#include // https://github.com/teemuatlut/TMCStepper #ifdef USE_TRINAMIC + #include // https://github.com/teemuatlut/TMCStepper void Trinamic_Init(); #endif