Skip to content

Commit 6f9e43c

Browse files
committed
ci(variants): manage mcu family naming higher than 2
Previously, mcu family name contained 2 characters except MP1. New series can have 3 characters, example WBA. So, manage it dynamically. Signed-off-by: Frederic Pillon <[email protected]>
1 parent 71a554b commit 6f9e43c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CI/update/stm32variant.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,10 +2141,11 @@ def merge_dir(out_temp_path, group_mcu_dir, mcu_family, periph_xml, variant_exp)
21412141
mcu_dir = group_mcu_dir[0]
21422142
# Merge if needed
21432143
if len(group_mcu_dir) != 1:
2144-
index_mcu_base = 5
2145-
# Key function
2146-
if "MP1" in mcu_family.name:
2147-
index_mcu_base += 1
2144+
# Handle mcu name length dynamically
2145+
# Add 3 for extra information line, #pin and flash
2146+
index_mcu_base = (
2147+
len(mcu_family.name.removeprefix("STM32").removesuffix("xx")) + 3
2148+
)
21482149

21492150
# Extract only dir name
21502151
for dir_name in group_mcu_dir:

0 commit comments

Comments
 (0)