Patch up version encoding

This commit is contained in:
zvecr 2022-07-19 02:14:53 +01:00
parent 819bf2eff8
commit f4f2002ed8

View File

@ -244,9 +244,9 @@ def generate_header(output_file, keyboard, keymap):
# Versions
prog = re.compile(r'^(\d+)\.(\d+)\.(\d+)')
b = prog.match(xap_defs['version'])
lines.append(f'#define XAP_BCD_VERSION 0x{int(b.group(1)):02d}{int(b.group(2)):02d}{int(b.group(3)):04d}ul')
lines.append(f'#define XAP_BCD_VERSION 0x{int(b.group(1)):02X}{int(b.group(2)):02X}{int(b.group(3)):04X}ul')
b = prog.findall(git_get_version() or "") or [('0', '0', '0')]
lines.append(f'#define QMK_BCD_VERSION 0x{int(b[0][0]):02d}{int(b[0][1]):02d}{int(b[0][1]):04d}ul')
lines.append(f'#define QMK_BCD_VERSION 0x{int(b[0][0]):02X}{int(b[0][1]):02X}{int(b[0][2]):04X}ul')
keyboard_id = fnv1a_32(bytes(keyboard, 'utf-8'))
lines.append(f'#define XAP_KEYBOARD_IDENTIFIER 0x{keyboard_id:08X}ul')
lines.append('')