From cba4fdd1d2f9bd9d0f64b4c2fb2cc123f860957e Mon Sep 17 00:00:00 2001 From: skarg Date: Thu, 27 Nov 2008 04:36:02 +0000 Subject: [PATCH] Added avrdude support in ATmega Makefile. --- bacnet-stack/ports/atmega168/Makefile | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/bacnet-stack/ports/atmega168/Makefile b/bacnet-stack/ports/atmega168/Makefile index 25dc55f5..8a485445 100644 --- a/bacnet-stack/ports/atmega168/Makefile +++ b/bacnet-stack/ports/atmega168/Makefile @@ -3,8 +3,8 @@ ############################################################################### ## General Flags -PROJECT = bacnet MCU = atmega168 +AVRDUDE_MCU = m168 TARGET = bacnet ## Tools CC = avr-gcc @@ -12,8 +12,22 @@ AR = avr-ar OBJCOPY = avr-objcopy OBJDUMP = avr-objdump SIZE = avr-size +AVRDUDE = avrdude LINT = splint +# programmer id--check the avrdude for complete list +# # of available opts. These should include stk500, +# # avr910, avrisp, bsd, pony and more. Set this to +# # one of the valid "-c PROGRAMMER-ID" values +# # described in the avrdude info page. +# # +AVRDUDE_PROGRAMMERID = avrispmkII +# +# # port--serial or parallel port to which your +# # hardware programmer is attached +# # +AVRDUDE_PORT = /dev/ttyUSB0 + # Source locations BACNET_CORE = ../../src BACNET_INCLUDE = ../../include @@ -171,11 +185,16 @@ $(LIBRARY): $(COREOBJ) Makefile size: ${TARGET_ELF} @echo - @${SIZE} -C --mcu=${MCU} ${TARGET_ELF} + @${SIZE} ${TARGET_ELF} lint: $(LINT) $(BFLAGS) $(CSRC) +install: $(TARGET_ELF) + $(AVRDUDE) -c $(AVRDUDE_PROGRAMMERID) \ + -p $(AVRDUDE_MCU) -P $(AVRDUDE_PORT) -e \ + -U flash:w:$(TARGET).hex + ## Clean target .PHONY: clean clean: