TMCStepper icon indicating copy to clipboard operation
TMCStepper copied to clipboard

TMCStepper incompatibility with Arduino Nano 33 BLE and probably ESP8266 boards too

Open Raztou3D opened this issue 3 years ago • 1 comments

Dear teemuatlut,

Thank you for the library !

I encountered an issue when using the "Simple" example on my Arduino Nano 33 BLE board with a TMC2209 board. The problem is that there is a name collision between a macro call "D1" in the core library of the Nano 33 BLE and a function called "D1" in your TMCStepper library. To solve the issue, I had to add "#undef D1" on line 18 of TMCStepper.h file: C:\Users\XXX\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.3.2\variants\ARDUINO_NANO33BLE/pins_arduino.h:82:14: error: expected unqualified-id before numeric constant #define D1 1 C:\Users\XXX\Documents\Arduino\libraries\TMCStepper-master\src/TMCStepper.h:608:12: note: in expansion of macro 'D1' uint16_t D1();

Maybe there is something you can do to avoid this issue for future users. I personally had to write on the Arduino forum to find a solution.

Best,

Raztou3D

Raztou3D avatar Mar 05 '21 08:03 Raztou3D

Ah the joys of problems inherited from C and preprocessor macros polluting namespaces...

teemuatlut avatar Mar 06 '21 19:03 teemuatlut