Arduino Due conditional compilation constant for custom library

arduino, arduino-ide

Solution

I typically use ...

#ifndef __AVR__
// something special just for non AVR8's
// ...
#endif

Where as I believe you could also use...

#ifdef _SAM3XA_
// something special just for Due's SAM3XA
// ...
#endif

Problem

I'm writing a custom library and it is working correctly on an Arduino Uno. However I've now got my hands on an Arduino Due and I need to define some board specific pin constants. I know for most boards you can do this through an `#ifdef` directive using the IO constants defined in `\\arduino-1.5.2\hardware\tools\avr\avr\include\avr\io.h`. For instance: ``` #if defined (__AVR_ATmega128__) //do something specific #endif ``` Does anybody know which is the correct constant to use for the Due?

Original source