summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2022-01-17 08:44:34 +1100
committerGitHub <noreply@github.com>2022-01-17 08:44:34 +1100
commitc72ed7c02473dec4da6cb263c1e0fb2ca4856b94 (patch)
tree4c218562b5ed5bbd34da67f37093ba6f47012d57 /lib/python/qmk/cli
parent557fbbd6afbff3bdd571e580ea79ba3905a28ce4 (diff)
downloadqmk_firmware-c72ed7c02473dec4da6cb263c1e0fb2ca4856b94.tar.gz
qmk_firmware-c72ed7c02473dec4da6cb263c1e0fb2ca4856b94.zip
CLI: Parse USB device version BCD (#14580)
* CLI: Parse USB device version BCD * Apply suggestions
Diffstat (limited to 'lib/python/qmk/cli')
-rwxr-xr-xlib/python/qmk/cli/generate/config_h.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py
index f16dca1de8..6b1012fae7 100755
--- a/lib/python/qmk/cli/generate/config_h.py
+++ b/lib/python/qmk/cli/generate/config_h.py
@@ -108,6 +108,12 @@ def generate_config_items(kb_info_json, config_h_lines):
config_h_lines.append(f'#ifndef {key}')
config_h_lines.append(f'# define {key} {value}')
config_h_lines.append(f'#endif // {key}')
+ elif key_type == 'bcd_version':
+ (major, minor, revision) = config_value.split('.')
+ config_h_lines.append('')
+ config_h_lines.append(f'#ifndef {config_key}')
+ config_h_lines.append(f'# define {config_key} 0x{major.zfill(2)}{minor}{revision}')
+ config_h_lines.append(f'#endif // {config_key}')
else:
config_h_lines.append('')
config_h_lines.append(f'#ifndef {config_key}')