@@ -370,10 +370,12 @@ def parseVersion(path):
370
370
main_found = False
371
371
sub1_found = False
372
372
sub2_found = False
373
+ rc_found = False
373
374
if "HAL" in str (path ):
374
375
main_pattern = re .compile (r"HAL_VERSION_MAIN.*0x([\dA-Fa-f]+)" )
375
376
sub1_pattern = re .compile (r"HAL_VERSION_SUB1.*0x([\dA-Fa-f]+)" )
376
377
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]+)" )
377
379
else :
378
380
main_pattern = re .compile (
379
381
r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_MAIN.*0x([\dA-Fa-f]+)"
@@ -384,6 +386,9 @@ def parseVersion(path):
384
386
sub2_pattern = re .compile (
385
387
r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_SUB2.*0x([\dA-Fa-f]+)"
386
388
)
389
+ rc_pattern = re .compile (
390
+ r"(?:CMSIS|DEVICE|CMSIS_DEVICE)_VERSION_RC.*0x([\dA-Fa-f]+)"
391
+ )
387
392
388
393
for i , line in enumerate (open (path , encoding = "utf8" , errors = "ignore" )):
389
394
for match in re .finditer (main_pattern , line ):
@@ -395,7 +400,10 @@ def parseVersion(path):
395
400
for match in re .finditer (sub2_pattern , line ):
396
401
VERSION_SUB2 = int (match .group (1 ), 16 )
397
402
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 :
399
407
break
400
408
else :
401
409
print (f"Could not find the full version in { path } " )
@@ -408,7 +416,16 @@ def parseVersion(path):
408
416
if sub2_found :
409
417
print (f"sub2 version found: { VERSION_SUB2 } " )
410
418
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
412
429
413
430
414
431
def checkVersion (serie , repo_path ):
0 commit comments