[core] add BCD versions of QMK Version (#25804)
Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
@@ -3,9 +3,12 @@
|
||||
import contextlib
|
||||
import multiprocessing
|
||||
import sys
|
||||
import re
|
||||
|
||||
from milc import cli
|
||||
|
||||
TRIPLET_PATTERN = re.compile(r'^(\d+)\.(\d+)\.(\d+)')
|
||||
|
||||
maybe_exit_should_exit = True
|
||||
maybe_exit_reraise = False
|
||||
|
||||
@@ -96,3 +99,10 @@ def parallel_map(*args, **kwargs):
|
||||
# before the results are returned. Returning a list ensures results are
|
||||
# materialised before any worker pool is shut down.
|
||||
return list(map_fn(*args, **kwargs))
|
||||
|
||||
|
||||
def triplet_to_bcd(ver: str):
|
||||
m = TRIPLET_PATTERN.match(ver)
|
||||
if not m:
|
||||
return '0x00000000'
|
||||
return f'0x{int(m.group(1)):02d}{int(m.group(2)):02d}{int(m.group(3)):04d}'
|
||||
|
||||
Reference in New Issue
Block a user