@@ -370,10 +370,12 @@ def parseVersion(path):
370370 main_found = False
371371 sub1_found = False
372372 sub2_found = False
373+ rc_found = False
373374 if "HAL" in str (path ):
374375 main_pattern = re .compile (r"HAL_VERSION_MAIN.*0x([\dA-Fa-f]+)" )
375376 sub1_pattern = re .compile (r"HAL_VERSION_SUB1.*0x([\dA-Fa-f]+)" )
376377 sub2_pattern = re .compile (r"HAL_VERSION_SUB2.*0x([\dA-Fa-f]+)" )
378+ rc_pattern = re .compile (r"HAL_VERSION_RC.*0x([\dA-Fa-f]+)" )
377379 else :
378380 main_pattern = re .compile (
379381 r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_MAIN.*0x([\dA-Fa-f]+)"
@@ -384,6 +386,9 @@ def parseVersion(path):
384386 sub2_pattern = re .compile (
385387 r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_SUB2.*0x([\dA-Fa-f]+)"
386388 )
389+ rc_pattern = re .compile (
390+ r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_RC.*0x([\dA-Fa-f]+)"
391+ )
387392
388393 for i , line in enumerate (open (path , encoding = "utf8" , errors = "ignore" )):
389394 for match in re .finditer (main_pattern , line ):
@@ -395,7 +400,10 @@ def parseVersion(path):
395400 for match in re .finditer (sub2_pattern , line ):
396401 VERSION_SUB2 = int (match .group (1 ), 16 )
397402 sub2_found = True
398- if main_found and sub1_found and sub2_found :
403+ for match in re .finditer (rc_pattern , line ):
404+ VERSION_RC = int (match .group (1 ), 16 )
405+ rc_found = True
406+ if main_found and sub1_found and sub2_found and rc_found :
399407 break
400408 else :
401409 print (f"Could not find the full version in { path } " )
@@ -408,7 +416,16 @@ def parseVersion(path):
408416 if sub2_found :
409417 print (f"sub2 version found: { VERSION_SUB2 } " )
410418 VERSION_SUB2 = "FF"
411- return f"{ VERSION_MAIN } .{ VERSION_SUB1 } .{ VERSION_SUB2 } "
419+ if rc_found :
420+ print (f"rc version found: { VERSION_RC } " )
421+ VERSION_RC = "FF"
422+
423+ ret = f"{ VERSION_MAIN } .{ VERSION_SUB1 } .{ VERSION_SUB2 } "
424+
425+ if VERSION_RC != 0 :
426+ ret = f"{ ret } RC{ VERSION_RC } "
427+
428+ return ret
412429
413430
414431def checkVersion (serie , repo_path ):
0 commit comments