@@ -29,11 +29,12 @@ all_LL_file=stm32yyxx_ll.h
29
29
30
30
# Create the file
31
31
print_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 "
37
38
}
38
39
39
40
# Add some pragma to ll header files to avoid several warnings
@@ -57,11 +58,11 @@ print_CMSIS_Startup_header() {
57
58
}
58
59
59
60
print_CMSIS_Startup_footer () {
60
- echo " #else
61
- #error UNKNOWN CHIP
62
- #endif
61
+ echo " #else
62
+ #error UNKNOWN CHIP
63
+ #endif
63
64
#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\"
65
66
#endif /* !CMSIS_STARTUP_FILE && !CUSTOM_STARTUP_FILE */
66
67
#endif /* _STM32_DEF_BUILD_ */" >> $CMSIS_Startupfile
67
68
}
@@ -73,17 +74,17 @@ print_CMSIS_Startup_list() {
73
74
local upper
74
75
f=$( echo " ${list[0]} " | awk -F/ ' {print $NF}' )
75
76
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
78
79
79
80
if [ ${# list[@]} -gt 1 ]; then
80
81
for fp in " ${list[@]: 1} " ; do
81
82
# File name
82
83
f=$( echo " $fp " | awk -F/ ' {print $NF}' )
83
84
upper=$( echo " $f " | awk -F' [_.]' ' {print toupper($2)}' | tr X x)
84
85
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
87
88
done
88
89
fi
89
90
}
@@ -108,6 +109,10 @@ for serie in "${series[@]}"; do
108
109
# Generate stm32yyxx_[hal|ll]*.c file
109
110
filelist=($( find $HALDrivers_path /STM32" ${serie} " xx_HAL_Driver/Src -maxdepth 1 -name " stm32${lower} xx_*.c" ) )
110
111
for fp in " ${filelist[@]} " ; do
112
+ # No need for template
113
+ if [[ $fp = * " template" * ]]; then
114
+ continue
115
+ fi
111
116
outp=$HALoutSrc_path
112
117
# File name
113
118
f=$( echo " $fp " | awk -F/ ' {print $NF}' )
@@ -122,7 +127,7 @@ for serie in "${series[@]}"; do
122
127
# Amend file name under serie switch
123
128
{
124
129
echo " #ifdef STM32${serie} xx"
125
- echo " #include \" $f \" "
130
+ echo " #include \" $f \" "
126
131
echo " #endif"
127
132
} >> $outp /" $g "
128
133
done
@@ -143,7 +148,7 @@ for serie in "${series[@]}"; do
143
148
# Amend file name under serie switch
144
149
{
145
150
echo " #ifdef STM32${serie} xx"
146
- echo " #include \" $f \" "
151
+ echo " #include \" $f \" "
147
152
echo " #endif"
148
153
} >> $LLoutInc_path /" $g "
149
154
done
@@ -160,10 +165,10 @@ sort -u $LLoutInc_path/${all_LL_file}.tmp >> $LLoutInc_path/${all_LL_file}
160
165
rm -f $LLoutInc_path /${all_LL_file} .tmp
161
166
162
167
# 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
167
172
168
173
# Search all LL header files to end guard
169
174
filelist=($( find $LLoutInc_path -maxdepth 1 -name " stm32yyxx_ll*.h" ) )
0 commit comments