Skip to content

Commit 782fbaf

Browse files
committedMar 25, 2025
ci(stm32variant): improve skip feature
avoid to parse the xml file if family have to be skipped Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 7ef0723 commit 782fbaf

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed
 

‎CI/update/stm32variant.py

+15-12
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,19 @@ def parse_mcu_file():
178178

179179
if mcu_family.endswith("+"):
180180
mcu_family = mcu_family[:-1]
181+
182+
# Generate only for specified pattern series or supported one
183+
# Check if mcu_family is supported by the core
184+
if (
185+
mcu_family not in stm32_list
186+
or args.serie
187+
and serie_pattern.search(mcu_family) is None
188+
):
189+
if mcu_family not in ignored_stm32_list and mcu_family not in stm32_list:
190+
ignored_stm32_list.append(mcu_family)
191+
xml_mcu.unlink()
192+
return False
193+
181194
mcu_refname = mcu_node.attributes["RefName"].value
182195
core_node = mcu_node.getElementsByTagName("Core")
183196
for f in core_node:
@@ -213,6 +226,7 @@ def parse_mcu_file():
213226
else:
214227
if gpiofile == "" and s.attributes["Name"].value == "GPIO":
215228
gpiofile = s.attributes["Version"].value
229+
return True
216230

217231

218232
def get_gpio_af_num(pintofind, iptofind):
@@ -2742,18 +2756,7 @@ def manage_repo():
27422756
for mcu_file in mcu_list:
27432757
# Open input file
27442758
xml_mcu = parse(str(mcu_file))
2745-
parse_mcu_file()
2746-
2747-
# Generate only for specified pattern series or supported one
2748-
# Check if mcu_family is supported by the core
2749-
if (
2750-
mcu_family not in stm32_list
2751-
or args.serie
2752-
and serie_pattern.search(mcu_family) is None
2753-
):
2754-
if mcu_family not in ignored_stm32_list and mcu_family not in stm32_list:
2755-
ignored_stm32_list.append(mcu_family)
2756-
xml_mcu.unlink()
2759+
if parse_mcu_file() is False:
27572760
continue
27582761

27592762
# Add mcu family to the list of directory to aggregate

0 commit comments

Comments
 (0)
Failed to load comments.