HW_DIR = CPU_DIR + "arm/hw/"
MK_FLASH_SCRIPT = PRG_SCRIPTS_DIR + "arm/flash.sh"
+MK_STOPFLASH_SCRIPT = PRG_SCRIPTS_DIR + "arm/stopflash.sh"
MK_DEBUG_SCRIPT = PRG_SCRIPTS_DIR + "arm/debug.sh"
+MK_STOPDEBUG_SCRIPT = PRG_SCRIPTS_DIR + "arm/stopdebug.sh"
GDB_INIT_SCRIPT = PRG_SCRIPTS_DIR + "arm/openocd/gdbinit-sam7"
SCRIPT_DIR = CPU_DIR + "avr/scripts/"
MK_FLASH_SCRIPT = PRG_SCRIPTS_DIR + "avr/flash.sh"
+MK_STOPFLASH_SCRIPT = PRG_SCRIPTS_DIR + "avr/stopflash.sh"
MK_DEBUG_SCRIPT = PRG_SCRIPTS_DIR + "avr/debug.sh"
+MK_STOPDEBUG_SCRIPT = PRG_SCRIPTS_DIR + "avr/stopdebug.sh"
# Common GCC flags.
MK_CPU_CPPFLAGS = "-Os -fno-strict-aliasing -I" + CPU_DIR + "avr/"
.PHONY: flash_$(1)_local
flash_$(1)_local:
+.PHONY: stopflash_$(1)
+stopflash_$(1):
+ $L "$(1): Stopping target flashing"
+ $Q if [ ! -f $$($(1)_STOPFLASH_SCRIPT) ] ; then \
+ printf "No stopflash script found.\n" ; \
+ exit 1 ; \
+ fi
+ $Q $$($(1)_STOPFLASH_SCRIPT) ;
+
+
# Debug target
.PHONY: debug_$(1)
debug_$(1): $(OUTDIR)/$(1).elf
exit 1 ; \
fi
+.PHONY: stopdebug_$(1)
+stopdebug_$(1):
+ $L "$(1): Stopping debugger"
+ $Q if [ ! -f $$($(1)_STOPDEBUG_SCRIPT) ] ; then \
+ printf "No stopdebug script found.\n" ; \
+ exit 1 ; \
+ fi
+ $Q $$($(1)_STOPDEBUG_SCRIPT) ;
+
.PHONY: fuses_$(!)
fuses_$(1):
if [ ! -z "$$($(1)_efuse)" ] ; then \