From 674f70b6c327f3a1ef43354cd8d7857620263686 Mon Sep 17 00:00:00 2001 From: Robert Quattlebaum Date: Sat, 16 Feb 2013 15:35:31 -0800 Subject: [PATCH] cpu/avr: Added "AVRDUDE_MCU" configuration parameter. --- cpu/avr/Makefile.avr | 10 ++++++++-- platform/avr-atmega128rfa1/Makefile.avr-atmega128rfa1 | 1 + platform/avr-raven/Makefile.avr-raven | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cpu/avr/Makefile.avr b/cpu/avr/Makefile.avr index 42a51fb78..17f4c9b56 100644 --- a/cpu/avr/Makefile.avr +++ b/cpu/avr/Makefile.avr @@ -192,17 +192,23 @@ endif ### Upload image #Let avrdude use defaults if port or programmer not defined +AVRDUDE ?= avrdude ifdef AVRDUDE_PORT AVRDUDE_PORT:=-P $(AVRDUDE_PORT) endif ifdef AVRDUDE_PROGRAMMER AVRDUDE_PROGRAMMER:=-c $(AVRDUDE_PROGRAMMER) endif +ifdef AVRDUDE_MCU + AVRDUDE_MCU:=-p $(AVRDUDE_MCU) +else + AVRDUDE_MCU:=-p $(MCU) +endif %.u: %.hex - avrdude $(AVRDUDE_OPTIONS) $(AVRDUDE_PORT) $(AVRDUDE_PROGRAMMER) -p $(MCU) -U flash:w:$< + $(AVRDUDE) $(AVRDUDE_MCU) $(AVRDUDE_OPTIONS) $(AVRDUDE_PORT) $(AVRDUDE_PROGRAMMER) -U flash:w:$< %.eu: %.eep - avrdude ${AVRDUDE_OPTIONS} -P ${AVRDUDE_PORT} -c ${AVRDUDE_PROGRAMMER} -p ${MCU} -U eeprom:w:$< + $(AVRDUDE) $(AVRDUDE_MCU) ${AVRDUDE_OPTIONS} ${AVRDUDE_PORT} ${AVRDUDE_PROGRAMMER} -U eeprom:w:$< symbols.c: cp ${CONTIKI}/tools/empty-symbols.c symbols.c diff --git a/platform/avr-atmega128rfa1/Makefile.avr-atmega128rfa1 b/platform/avr-atmega128rfa1/Makefile.avr-atmega128rfa1 index 46b03bf28..b9a792c85 100644 --- a/platform/avr-atmega128rfa1/Makefile.avr-atmega128rfa1 +++ b/platform/avr-atmega128rfa1/Makefile.avr-atmega128rfa1 @@ -26,6 +26,7 @@ AVRDUDE_PORT=usb:00B000000D79 # Additional avrdude options # Verify off AVRDUDE_OPTIONS=-V +AVRDUDE_MCU=m128rfa1 include $(CONTIKIAVR)/Makefile.avr diff --git a/platform/avr-raven/Makefile.avr-raven b/platform/avr-raven/Makefile.avr-raven index 3b19fa9b9..23544ec03 100644 --- a/platform/avr-raven/Makefile.avr-raven +++ b/platform/avr-raven/Makefile.avr-raven @@ -14,7 +14,6 @@ CONTIKIBOARD=. CONTIKI_PLAT_DEFS = -DF_CPU=8000000UL -DAUTO_CRC_PADDING=2 MCU=atmega1284p -AVRDUDE_PROGRAMMER=jtag2 # For usb devices, you may either use PORT=usb, or (e.g. if you have more than one # programmer connected) you can use the following trick to find out the serial number: @@ -24,12 +23,14 @@ AVRDUDE_PROGRAMMER=jtag2 #AVRDUDE_PORT=usb:00B000000D79 AVRDUDE_PORT=usb +# Assume that the user has already configured AVRDUDE to use a specific programmer. +#AVRDUDE_PROGRAMMER?=jtag2 # Additional avrdude options # Verify off #AVRDUDE_OPTIONS=-V -AVRDUDE_OPTIONS= +AVRDUDE_MCU=m1284p include $(CONTIKIAVR)/Makefile.avr include $(CONTIKIAVR)/radio/Makefile.radio