@@ -1584,10 +1584,11 @@ def print_variant(generic_list, alt_syswkup_list):
1584
1584
)
1585
1585
1586
1586
1587
- def search_product_line (valueline ) :
1587
+ def search_product_line (valueline : str , extra : str ) -> str :
1588
1588
product_line = ""
1589
+ product_line_list = product_line_dict [mcu_family ]
1589
1590
if not valueline .startswith ("STM32MP1" ):
1590
- for pline in product_line_dict [ mcu_family ] :
1591
+ for idx_pline , pline in enumerate ( product_line_list ) :
1591
1592
vline = valueline
1592
1593
product_line = pline
1593
1594
# Remove the 'x' character from pline and
@@ -1600,6 +1601,10 @@ def search_product_line(valueline):
1600
1601
else :
1601
1602
break
1602
1603
if pline >= vline :
1604
+ if extra and len (product_line_list ) > idx_pline + 1 :
1605
+ if product_line_list [idx_pline + 1 ] == (product_line + extra ):
1606
+ # Look for the next product line if contains the extra
1607
+ product_line = product_line_list [idx_pline + 1 ]
1603
1608
break
1604
1609
else :
1605
1610
# In case of CMSIS device does not exist
@@ -1698,11 +1703,14 @@ def print_boards_entry():
1698
1703
}
1699
1704
)
1700
1705
# Search product line for last flash size
1706
+ # Keep the AQ if any
1707
+ subp = pl_regex .search (subf .group (3 ))
1701
1708
product_line = search_product_line (
1702
1709
"STM32"
1703
1710
+ subf .group (1 )
1704
1711
+ subf .group (2 ).split ("-" )[- 1 ]
1705
- + package_regex .sub (r"" , subf .group (3 ))
1712
+ + package_regex .sub (r"" , subf .group (3 )),
1713
+ subp .group (1 ) if subp and subp .group (1 ) is not None else "" ,
1706
1714
)
1707
1715
else :
1708
1716
valueline = mcu_refname
@@ -1715,7 +1723,11 @@ def print_boards_entry():
1715
1723
"svd" : search_svdfile (mcu_refname ),
1716
1724
}
1717
1725
)
1718
- product_line = search_product_line (package_regex .sub (r"" , valueline ))
1726
+ subp = pl_regex .search (valueline )
1727
+ product_line = search_product_line (
1728
+ package_regex .sub (r"" , valueline ),
1729
+ subp .group (1 ) if subp and subp .group (1 ) is not None else "" ,
1730
+ )
1719
1731
1720
1732
gen_entry = mcu_family .replace ("STM32" , "Gen" )
1721
1733
@@ -2685,6 +2697,7 @@ def manage_repo():
2685
2697
# Clean temporary dir
2686
2698
deleteFolder (tmp_dir )
2687
2699
2700
+ pl_regex = re .compile (r"([AQ])$" )
2688
2701
package_regex = re .compile (r"[\w][\w]([ANPQSXZ])?$" )
2689
2702
flash_group_regex = re .compile (r"(.*)\((.*)\)(.*)" )
2690
2703
0 commit comments