Detect Teensy 3, C preprocessor

Status
Not open for further replies.

michu

Member
I would like to check if the current Arduino code is compiled for a teensy3 or not. I know there are some Teensy specific defines like

#if defined (CORE_TEENSY_SERIAL)

but are the any teensy 3 specific ones?

cheers
 
Looking at hardware/teensy/boards.txt, I would imagine the define you are looking for is: '__MK20DX128__' (two leading underscores and two trailing underscores). If you have no other ARM based microprocessors like the Arduino Due, you could just use '__arm__' instead.

Checking over at arduino 1.5.1, it looks like the Due sets '__SAM3X8E__'.
:cool:
 
Last edited:
You can also use.

#if defined(__arm__) && defined(CORE_TEENSY)

This will match to today's Teensy 3.0 and the upcoming Teensy++ 3.0 later this year.
 
Damn, you ring my bell, Paul you get my full attention again.
Unfortunately, as Paul has mentioned, he can't discuss details of the Teensy 3.0++ which uses an unannounced chip. It appears this chip is late, so until Freescale (or whomever makes the chip) announces the chip and can get the yield up, we are just playing the waiting game.
 
For many reasons, I hope 3.0++ uses an NXP ARM chip.
I'd volunteer to help with the chip-specific code migration.
 
Status
Not open for further replies.
Back
Top