peplin/arduino.mk — Issue #4: Switch between Arduino and chipKIT
Author: rei-vilo
Created: 2012-01-25 21:53:31+00:00
State: open

Enclosed in this list of the supported AVR and PIC32 boards.

makefile starts with

```
TARGET = blink

BOARD_TAG = uno_pic32

ARDUINO_MAKEFILE_HOME = $(CURDIR)
ARDUINO_DIR = /Applications/Mpide.app/Contents/Resources/Java
ARDUINO_PORT = /dev/tty.usbmodem*
```

Test if the BOARD_TAG is listed in .../pic32/boards.txt,

```
FLAG = $(shell grep $(BOARD_TAG) $(ARDUINO_DIR)/hardware/pic32/boards.txt)
```

If it is a PIC32 board, call

```
include $(ARDUINO_MAKEFILE_HOME)/chipKIT.mk
```

otherwise, it is an AVR board, go directly to

```
include $(ARDUINO_MAKEFILE_HOME)/Arduino.mk
```

I've tried ```ifneq(FLAG,)``` for the switch, but with no convincing results.

--------

>
**PIC32 boards**
*/Applications/Mpide.app/Contents/Resources/Java/hardware/pic32/boards.txt*
>
uno_pic32.name=chipKIT UNO32
mega_pic32.name=chipKIT MAX32
mega_usb_pic32.name=chipKIT MAX32-USB for Serial
cerebot_mx3ck.name=Cerebot MX3cK
cerebot_mx4ck.name=Cerebot MX4cK
cerebot_mx7ck.name=Cerebot MX7cK
cerebot32mx4.name=Cerebot 32MX4
cerebot32mx7.name=Cerebot 32MX7
mc_pic32_starterkit.name=Microchip PIC32 Starter kit
mc_pic32_ethernet_starterkit.name=Microchip PIC32 Ethernet Starter kit
mc_pic32_usb_starterkit.name=Microchip PIC32 USB Starter kit II
mc_pic32_explorer16.name=Microchip PIC32 Explorer 16
mikroe_multimedia.name=MirkoElektronika PIC32 Multimedia Board
mikroe_mikromedia.name=MirkoElektronika PIC32 mikroMedia Board
ubw32_mx460.name=Pic32 UBW32-MX460
ubw32_mx795.name=Pic32 UBW32-MX795
cui32.name=Pic32 CUI32-Development Stick
>
>
**Arduino boards**
*/Applications/Mpide.app/Contents/Resources/Java/hardware/arduino/boards.txt*
>
uno.name=Arduino Uno
atmega328.name=Arduino Duemilanove or Nano w/ ATmega328
diecimila.name=Arduino Diecimila, Duemilanove, or Nano w/ ATmega168
mega2560.name=Arduino Mega 2560
mega.name=Arduino Mega (ATmega1280)
mini.name=Arduino Mini
fio.name=Arduino Fio
bt328.name=Arduino BT w/ ATmega328
bt.name=Arduino BT w/ ATmega168
lilypad328.name=LilyPad Arduino w/ ATmega328
lilypad.name=LilyPad Arduino w/ ATmega168
pro5v328.name=Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega328
pro5v.name=Arduino Pro or Pro Mini (5V, 16 MHz) w/ ATmega168
pro328.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega328
pro.name=Arduino Pro or Pro Mini (3.3V, 8 MHz) w/ ATmega168
atmega168.name=Arduino NG or older w/ ATmega168
atmega8.name=Arduino NG or older w/ ATmega8
>