diff options
Diffstat (limited to 'include.mk')
-rw-r--r-- | include.mk | 34 |
1 files changed, 29 insertions, 5 deletions
@@ -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)/$@,) |