I was updating some t3.6 classes to run on T4.0 or Arduino Uno and tried to use the follow to implement the core specific code:
The problem I found was that CORE_TEENSY was intermittently defined, so my core detection code compiled for both Teensy 3.6 and Arduino cores causing problems.
I can get round the problem using TEENSYDUINO:
So, my question is really, why is the CORE_TEENSY unreliable compared to TEENSYDUINO in my usage context, when I see CORE_TEENSY so much in internal library functions?
I've included a test build. Just compile under T4, T3.6 and Arduino Uno and see the compilation output.
Code:
#if (defined(CORE_TEENSY) && defined(__arm__))
...
#endif
I can get round the problem using TEENSYDUINO:
Code:
#if (defined(__IMXRT1052__) || defined(__IMXRT1062__))
#warning("T4") // Teensy 4 //
#elif (defined(TEENSYDUINO))
#warning("T3") // Teensy 3+ //
#else
#warning("OP") // Other processor //
#endif
So, my question is really, why is the CORE_TEENSY unreliable compared to TEENSYDUINO in my usage context, when I see CORE_TEENSY so much in internal library functions?
I've included a test build. Just compile under T4, T3.6 and Arduino Uno and see the compilation output.