From dbf23e8334e9af3605130124e7cb1738fd522771 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 19 May 2012 16:46:24 +0000 Subject: added support for arduino2009 git-svn-id: https://svn.spreadspace.org/avr/trunk@14 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- include.mk | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'include.mk') diff --git a/include.mk b/include.mk index f548e6d..fac4154 100644 --- a/include.mk +++ b/include.mk @@ -45,12 +45,21 @@ MCU := atmega32u4 F_CPU := 16000000 PROG := DFU endif +ifeq ($(BOARD_TYPE),arduino2009) +MCU := atmega168 +F_CPU := 16000000 +PROG := avrdude +UPLOAD_RATE := 19200 +PROG_TYPE := stk500v1 +AVRDUDE_PORT := /dev/ttyUSB0 +endif CC = avr-gcc OBJCOPY = avr-objcopy DFU = dfu-programmer teensy = teensy_loader_cli +avrdude = avrdude ## Options common to compile, link and assembly rules COMMON = -mmcu=$(MCU) @@ -125,7 +134,7 @@ define DFU/run $(DFU) $(MCU) start endef -### teensy-Programmer +### teensy-loader define teensy/erase endef @@ -139,15 +148,30 @@ endef define teensy/run endef +### avrdude +define avrdude/erase + $(avrdude) -V -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(PROG_TYPE) -b $(UPLOAD_RATE) -e +endef + +define avrdude/program + $(avrdude) -V -F -p $(MCU) -P $(AVRDUDE_PORT) -c $(PROG_TYPE) -b $(UPLOAD_RATE) -D -U flash:w:$1 +endef + +define avrdude/reset +endef + +define avrdude/run +endef + ### Program Targets erase: - $(call $(PROG)/$@, ) + $(call $(PROG)/$@,) program: $(HEXFILE) erase - $(call $(PROG)/$@, $(HEXFILE)) + $(call $(PROG)/$@,$(HEXFILE)) reset: - $(call $(PROG)/$@, ) + $(call $(PROG)/$@,) run: - $(call $(PROG)/$@, ) + $(call $(PROG)/$@,) -- cgit v1.2.3