Add support for stopping debugging/flashing.
authorbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 4 Sep 2009 13:14:59 +0000 (13:14 +0000)
committerbatt <batt@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 4 Sep 2009 13:14:59 +0000 (13:14 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2880 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/cpu/arm/info/at91sam7.common
bertos/cpu/avr/info/avr.common
bertos/rules.mk

index 1f3f9cb8173cf7d589cf36eded96ba1dd08f2af8..654cb0bca5c8b5eef107f63a2004619dd163eae9 100644 (file)
@@ -71,7 +71,9 @@ SCRIPT_DIR = CPU_DIR + "arm/scripts/"
 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"
 
index 1dab8507ce193cfc577815d08a03441db0b05938..41b8d0d299ed6efb39a2fcbcca86bb9231d6998d 100644 (file)
@@ -60,7 +60,9 @@ CPU_DEFAULT_FREQ = "8000000UL"
 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/"
index 11f8aebbbc80ff07fb1aa8ed5cc8e1e8d13436b4..0bcefe63ac79286cf44212fb363b93b11eef40a2 100644 (file)
@@ -261,6 +261,16 @@ flash_$(1): $(OUTDIR)/$(1).hex flash_$(1)_local
 .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
@@ -279,6 +289,15 @@ 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 \