@@ -29,11 +29,12 @@ all_LL_file=stm32yyxx_ll.h
2929
3030# Create the file
3131print_C_header () {
32- if [[$1 = * " template" * ]]; then
33- echo " #if 0" > " $1 "
34- else
35- touch" $1 "
36- fi
32+ # if [[ $1 = *"template"* ]]; then
33+ # echo "#if 0" > "$1"
34+ # else
35+ # touch "$1"
36+ # fi
37+ touch" $1 "
3738}
3839
3940# Add some pragma to ll header files to avoid several warnings
@@ -57,11 +58,11 @@ print_CMSIS_Startup_header() {
5758}
5859
5960print_CMSIS_Startup_footer () {
60- echo " #else
61- #error UNKNOWN CHIP
62- #endif
61+ echo " #else
62+ #error UNKNOWN CHIP
63+ #endif
6364#else
64- #warning\" No CMSIS startup file defined, custom one should be used\"
65+ #warning\" No CMSIS startup file defined, custom one should be used\"
6566#endif /* !CMSIS_STARTUP_FILE && !CUSTOM_STARTUP_FILE */
6667#endif /* _STM32_DEF_BUILD_ */" >> $CMSIS_Startupfile
6768}
@@ -73,17 +74,17 @@ print_CMSIS_Startup_list() {
7374local upper
7475 f=$( echo" ${list[0]} " | awk -F/' {print $NF}' )
7576 upper=$( echo" $f " | awk -F' [_.]' ' {print toupper($2)}' | tr X x)
76- echo " #if defined($upper )
77- #define CMSIS_STARTUP_FILE\" $f \" " >> $CMSIS_Startupfile
77+ echo " #if defined($upper )
78+ #define CMSIS_STARTUP_FILE\" $f \" " >> $CMSIS_Startupfile
7879
7980if [${# list[@]} -gt 1 ]; then
8081for fp in " ${list[@]: 1} " ; do
8182# File name
8283 f=$( echo" $fp " | awk -F/' {print $NF}' )
8384 upper=$( echo" $f " | awk -F' [_.]' ' {print toupper($2)}' | tr X x)
8485 upper=" ${upper// MP15xx/ MP1xx} "
85- echo " #elif defined($upper )
86- #define CMSIS_STARTUP_FILE\" $f \" " >> $CMSIS_Startupfile
86+ echo " #elif defined($upper )
87+ #define CMSIS_STARTUP_FILE\" $f \" " >> $CMSIS_Startupfile
8788done
8889fi
8990}
@@ -108,6 +109,10 @@ for serie in "${series[@]}"; do
108109# Generate stm32yyxx_[hal|ll]*.c file
109110 filelist=($( find$HALDrivers_path /STM32" ${serie} " xx_HAL_Driver/Src -maxdepth 1 -name" stm32${lower} xx_*.c" ) )
110111for fp in " ${filelist[@]} " ; do
112+ # No need for template
113+ if [[$fp = * " template" * ]]; then
114+ continue
115+ fi
111116 outp=$HALoutSrc_path
112117# File name
113118 f=$( echo" $fp " | awk -F/' {print $NF}' )
@@ -122,7 +127,7 @@ for serie in "${series[@]}"; do
122127# Amend file name under serie switch
123128 {
124129echo " #ifdef STM32${serie} xx"
125- echo " #include\" $f \" "
130+ echo " #include\" $f \" "
126131echo " #endif"
127132 }>> $outp /" $g "
128133done
@@ -143,7 +148,7 @@ for serie in "${series[@]}"; do
143148# Amend file name under serie switch
144149 {
145150echo " #ifdef STM32${serie} xx"
146- echo " #include\" $f \" "
151+ echo " #include\" $f \" "
147152echo " #endif"
148153 }>> $LLoutInc_path /" $g "
149154done
@@ -160,10 +165,10 @@ sort -u $LLoutInc_path/${all_LL_file}.tmp >> $LLoutInc_path/${all_LL_file}
160165rm -f$LLoutInc_path /${all_LL_file} .tmp
161166
162167# Search all template file to end "#if 0"
163- filelist=($( find$HALoutSrc_path -maxdepth 1 -name" stm32*_template.c" ) )
164- for fp in " ${filelist[@]} " ; do
165- echo " #endif /* 0 */" >> " $fp "
166- done
168+ # filelist=($(find $HALoutSrc_path -maxdepth 1 -name "stm32*_template.c"))
169+ # for fp in "${filelist[@]}"; do
170+ # echo "#endif /* 0 */" >> "$fp"
171+ # done
167172
168173# Search all LL header files to end guard
169174filelist=($( find$LLoutInc_path -maxdepth 1 -name" stm32yyxx_ll*.h" ) )