I maintain a library of Arduino code for sending/receiving/decoding IR signals. At times I need to detect which hardware platform I'm using so that I know things like the availability of hardware timers, interrupts etc. Typically I use conditional compiles such as
#if defined(AVR_ATmega32U4)
for example I presume this is a Leonardo or compatible platform. Which values if any should I check when detecting Arduino Due or Arduino Yun. Note I've never used either of those platforms so I realize it's a bit tricky to support them without any hardware to actually test but there are certain things I can implement just based on documentation. Therefore I'd like to support them in my library if I knew how to detect them.
There are two ways to find an identifier (define) that is always defined to specify the board being used.
In the IDE, turn on verbose output during compilation (File | Preference}, select the board your interested in, and using a basic sketch hit the compile button (not the upload). You can do this even if you don't have the board. You can then look at the avr-g++ command line for text that starts like this -DARDUINO_???? This is the define you can use in you code to conditionally execute code for that particular board.
or option
Open up the boards.txt file for your arduino installation (../arduino-1.5.6-r2/hardware/avr/boards.txt or ../arduino-1.5.6-r2/hardware/sam/boards.txt) and search for the definition of the board you are interested in. For the YUN it looks like this:
How can i flash a .hex file on Arduino Due board?
I have downloaded AVRdudes GUI but ATSAM3x is not there.? Is there any similar tool for flashing ATSAM processors?