diff options
author | Zach White <skullydazed@gmail.com> | 2021-01-09 20:18:47 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-09 20:18:47 -0800 |
commit | eaa9106ec74591593e638ac015a5c90d17b30612 (patch) | |
tree | 086c66b1ad3353c28a35489b6d17be32298b7bdd /lib/python | |
parent | 54a8262dfe3b3bf5e27024e1fdb18448bac53408 (diff) | |
download | qmk_firmware-eaa9106ec74591593e638ac015a5c90d17b30612.tar.gz qmk_firmware-eaa9106ec74591593e638ac015a5c90d17b30612.zip |
Add support for specifying BOARD in info.json (#11492)
* add support for specifying BOARD in info.json
* move BOARD from rules.mk to info.json for clueboard
* fix keyboards that do not require board
* remove out of compliance values
Diffstat (limited to 'lib/python')
-rwxr-xr-x | lib/python/qmk/cli/generate/rules_mk.py | 4 | ||||
-rw-r--r-- | lib/python/qmk/info.py | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/python/qmk/cli/generate/rules_mk.py b/lib/python/qmk/cli/generate/rules_mk.py index 0fdccb4048..b262e3c666 100755 --- a/lib/python/qmk/cli/generate/rules_mk.py +++ b/lib/python/qmk/cli/generate/rules_mk.py @@ -7,6 +7,7 @@ from qmk.info import info_json from qmk.path import is_keyboard, normpath info_to_rules = { + 'board': 'BOARD', 'bootloader': 'BOOTLOADER', 'processor': 'MCU', } @@ -37,7 +38,8 @@ def generate_rules_mk(cli): # Bring in settings for info_key, rule_key in info_to_rules.items(): - rules_mk_lines.append(f'{rule_key} ?= {kb_info_json[info_key]}') + if info_key in kb_info_json: + rules_mk_lines.append(f'{rule_key} ?= {kb_info_json[info_key]}') # Find features that should be enabled if 'features' in kb_info_json: diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 0ea5136a97..cc81f7a086 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -462,7 +462,7 @@ def _extract_rules_mk(info_data): """Pull some keyboard information from existing rules.mk files """ rules = rules_mk(info_data['keyboard_folder']) - mcu = rules.get('MCU') + mcu = rules.get('MCU', info_data.get('processor')) if mcu in CHIBIOS_PROCESSORS: arm_processor_rules(info_data, rules) @@ -594,6 +594,12 @@ def arm_processor_rules(info_data, rules): elif 'ARM_ATSAM' in rules: info_data['platform'] = 'ARM_ATSAM' + if 'BOARD' in rules: + if 'board' in info_data: + _log_warning(info_data, 'Board is specified in both info.json and rules.mk, the rules.mk value wins.') + + info_data['board'] = rules['BOARD'] + return info_data |