Skip to content

Commit 930184b

Browse files
committed
[gen_wrapper.sh] Update preproc indent
Remove "*_template.c" fiel which are useless Signed-off-by: Frederic Pillon <[email protected]>
1 parent cffb347 commit 930184b

6 files changed

+25
-160
lines changed

Diff for: CI/utils/gen_wrapper.sh

+24-19
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,12 @@ all_LL_file=stm32yyxx_ll.h
2929

3030
# Create the file
3131
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"
3738
}
3839

3940
# Add some pragma to ll header files to avoid several warnings
@@ -57,11 +58,11 @@ print_CMSIS_Startup_header() {
5758
}
5859

5960
print_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() {
7374
local 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

7980
if [ ${#list[@]} -gt 1 ]; then
8081
for 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
8788
done
8889
fi
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"))
110111
for 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
{
124129
echo "#ifdef STM32${serie}xx"
125-
echo "#include \"$f\""
130+
echo " #include \"$f\""
126131
echo "#endif"
127132
} >> $outp/"$g"
128133
done
@@ -143,7 +148,7 @@ for serie in "${series[@]}"; do
143148
# Amend file name under serie switch
144149
{
145150
echo "#ifdef STM32${serie}xx"
146-
echo "#include \"$f\""
151+
echo " #include \"$f\""
147152
echo "#endif"
148153
} >> $LLoutInc_path/"$g"
149154
done
@@ -160,10 +165,10 @@ sort -u $LLoutInc_path/${all_LL_file}.tmp >> $LLoutInc_path/${all_LL_file}
160165
rm -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
169174
filelist=($(find $LLoutInc_path -maxdepth 1 -name "stm32yyxx_ll*.h"))

Diff for: cores/arduino/stm32/LL/stm32yyxx_ll.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "stm32yyxx_ll_crs.h"
1717
#include "stm32yyxx_ll_dac.h"
1818
#include "stm32yyxx_ll_delayblock.h"
19-
#include "stm32yyxx_ll_dma2d.h"
2019
#include "stm32yyxx_ll_dma.h"
20+
#include "stm32yyxx_ll_dma2d.h"
2121
#include "stm32yyxx_ll_dmamux.h"
2222
#include "stm32yyxx_ll_exti.h"
2323
#include "stm32yyxx_ll_fmac.h"

Diff for: libraries/SrcWrapper/src/HAL/stm32yyxx_hal_msp_template.c

-44
This file was deleted.

Diff for: libraries/SrcWrapper/src/HAL/stm32yyxx_hal_timebase_rtc_alarm_template.c

-29
This file was deleted.

Diff for: libraries/SrcWrapper/src/HAL/stm32yyxx_hal_timebase_rtc_wakeup_template.c

-26
This file was deleted.

Diff for: libraries/SrcWrapper/src/HAL/stm32yyxx_hal_timebase_tim_template.c

-41
This file was deleted.

0 commit comments

Comments
 (0)