aboutsummaryrefslogtreecommitdiffstats
path: root/stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd
diff options
context:
space:
mode:
Diffstat (limited to 'stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd')
-rw-r--r--stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd38
1 files changed, 38 insertions, 0 deletions
diff --git a/stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd b/stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd
new file mode 100644
index 0000000..4c3b00e
--- /dev/null
+++ b/stm32conf/lanchon-stm32/src/exceptions/make-foreach.cmd
@@ -0,0 +1,38 @@
+setlocal
+
+set ADR=0x%~1
+set TYPE=%~2
+set NAME=%~3
+set TEXT=%~4
+set HELP=%~5
+
+set /a NUM=%ADR%/4
+if %TYPE%==x set NAME=__STM32ReservedException%NUM%
+if %TYPE%==e set FULLTYPE=Exception
+if %TYPE%==i set FULLTYPE=Interrupt
+set FULLTEXT=%TEXT% %FULLTYPE%
+if not "%HELP%"=="" set FULLHELP= (%HELP%)
+set FULL=[%ADR%] %FULLTEXT%%FULLHELP%
+
+rem echo %NAME%
+
+echo .long %NAME%>>lanchon-stm32-vector.S
+
+echo .weak %NAME%>>lanchon-stm32-isrs.S
+echo .globl %NAME%>>lanchon-stm32-isrs.S
+echo .set %NAME%, __STM32DefaultExceptionHandler>>lanchon-stm32-isrs.S
+
+echo EXTERN (%NAME%)>>lanchon-stm32-names.inc
+
+if %TYPE%==x goto :eof
+
+echo /* %FULL% */>>stm32exceptions.h
+echo void %NAME%(void);>>stm32exceptions.h
+echo.>>stm32exceptions.h
+
+echo /* %FULL% */>>stm32exceptions.c
+echo void %NAME%(void)>>stm32exceptions.c
+echo {>>stm32exceptions.c
+echo DEFAULT_EXCEPTION_HANDLER(%NAME%, "%TEXT%", %NUM%, %ADR%);>>stm32exceptions.c
+echo }>>stm32exceptions.c
+echo.>>stm32exceptions.c