diff options
author | David Lamparter <equinox@diac24.net> | 2012-09-19 19:42:13 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-09-20 05:18:49 +0200 |
commit | bada196ff124be7e283cbd9695ef1d97e2f35035 (patch) | |
tree | b38f4f25b2cd734a508f29f6bcec9b3ed3f1b8c6 | |
parent | 32182fe8b0e7af37f0cab0b5233e40414f7b629e (diff) |
Makefile: persist eeprom over chip erase
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -8,3 +8,4 @@ *.aux *.log *.pdf +eeprom @@ -11,13 +11,18 @@ CFLAGS_LD=-Wl,-T,avr4-signature.x CFLAGS=${CFLAGS_WARN} ${CFLAGS_OPT} ${CFLAGS_LD} MCU_door=48 MCU_lightctrl=88 +AVRDUDE=avrdude love: $(foreach target,$(TARGETS),$(target).elf) avr-size $^ ifdef TARGET flash: ${TARGET}.flash - avrdude -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y -U flash:w:$< + $(AVRDUDE) -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y \ + -U eeprom:r:eeprom:r + $(AVRDUDE) -p m$(MCU_$(basename $<)) -c stk500v2 -P avrdoper -y \ + -U flash:w:$< \ + -U eeprom:w:eeprom:r else flash: @echo the flash target is available only with TARGET set to something. use e.g. \"make flash TARGET=door\" >&2 |