@@ -1248,21 +1248,21 @@ def print_peripheral():
12481248# PinNamesVar.h generation
12491249def manage_syswkup ():
12501250 if len (syswkup_list ) != 0 :
1251- # Find the max range of SYS_WKUP to ensure it doesn't exceed
1252- # the current maximum range of SYS_WKUP used by STM32LowPower
1251+ # Find the max range of SYS_WKUP.
1252+ # Ensure it is compatible with the current maximum range
1253+ # used by STM32LowPower.
12531254 max_range = syswkup_list [- 1 ][2 ].replace ("SYS_WKUP" , "" )
1254- max_range = int (max_range ) if max_range else 1
1255+ max_range = int (max_range ) if max_range else 8
12551256 # F446 start from 0
12561257 base_index = 1
12571258 if syswkup_list [0 ][2 ].replace ("SYS_WKUP" , "" ) == "0" :
12581259 base_index = 0
12591260 max_range += 1
1260- if max_range > 8 :
1261- print (
1262- f"Error: SYS_WKUP range exceeds the current maximum range of 8 --> { max_range } ."
1263- )
1264- exit (1 )
1265- syswkup_pins_list = [[] for _ in range (8 )]
1261+ # Ensure the max_range is at least 8
1262+ # as some mcu PWR_WAKEUP_PINx while not SYS_WKUPx
1263+ if max_range < 8 :
1264+ max_range = 8
1265+ syswkup_pins_list = [[] for _ in range (max_range )]
12661266 for p in syswkup_list :
12671267 num = p [2 ].replace ("SYS_WKUP" , "" )
12681268 num = int (num ) if num else 1
@@ -1280,6 +1280,8 @@ def manage_syswkup():
12801280def print_pinamevar ():
12811281 # First check core version and search PWR_WAKEUP_*
12821282 syswkup_type = "PIN"
1283+ if "STM32WB0" in mcu_family :
1284+ syswkup_type = "PINNAME"
12831285 if mcu_core [0 ][1 ] == 33 :
12841286 # Search in stm32{series}xx_hal_pwr.h WR_WAKEUP_
12851287 pwr_header_file_path = (
0 commit comments