From 6e59bd8ce64966d6eb4fa0f4cecd0030396a1052 Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 5 Jan 2023 23:48:09 +0000 Subject: [PATCH 1/2] Ignore defaults.hjson values if already set --- keyboards/handwired/onekey/blackpill_f401_tinyuf2/info.json | 3 +-- keyboards/handwired/onekey/blackpill_f411_tinyuf2/info.json | 3 +-- lib/python/qmk/info.py | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/keyboards/handwired/onekey/blackpill_f401_tinyuf2/info.json b/keyboards/handwired/onekey/blackpill_f401_tinyuf2/info.json index ada49d384913..6787be36af49 100644 --- a/keyboards/handwired/onekey/blackpill_f401_tinyuf2/info.json +++ b/keyboards/handwired/onekey/blackpill_f401_tinyuf2/info.json @@ -1,8 +1,7 @@ { "keyboard_name": "Onekey Blackpill STM32F401 TinyUF2", - "processor": "STM32F401", + "development_board": "blackpill_f401", "bootloader": "tinyuf2", - "board": "BLACKPILL_STM32_F401", "matrix_pins": { "cols": ["B0"], "rows": ["A7"] diff --git a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/info.json b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/info.json index 3acccb7148e5..25d33a7ddec4 100644 --- a/keyboards/handwired/onekey/blackpill_f411_tinyuf2/info.json +++ b/keyboards/handwired/onekey/blackpill_f411_tinyuf2/info.json @@ -1,8 +1,7 @@ { "keyboard_name": "Onekey Blackpill STM32F411 TinyUF2", - "processor": "STM32F411", + "development_board": "blackpill_f411", "bootloader": "tinyuf2", - "board": "BLACKPILL_STM32_F411", "matrix_pins": { "cols": ["B0"], "rows": ["A7"] diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 7e588b518217..9dea4c73a534 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -562,7 +562,8 @@ def _process_defaults(info_data): thing_map = defaults_map[default_type] if default_type in info_data: for key, value in thing_map.get(info_data[default_type], {}).items(): - info_data[key] = value + if key not in info_data: + info_data[key] = value return info_data From 5729afa4a6b173f3e82c40c3810952f8abfc0dd9 Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 6 Jan 2023 00:14:17 +0000 Subject: [PATCH 2/2] Add warning when nothing is merged --- lib/python/qmk/info.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py index 9dea4c73a534..86b1e2c06332 100644 --- a/lib/python/qmk/info.py +++ b/lib/python/qmk/info.py @@ -561,9 +561,16 @@ def _process_defaults(info_data): for default_type in defaults_map.keys(): thing_map = defaults_map[default_type] if default_type in info_data: - for key, value in thing_map.get(info_data[default_type], {}).items(): + merged_count = 0 + thing_items = thing_map.get(info_data[default_type], {}).items() + for key, value in thing_items: if key not in info_data: info_data[key] = value + merged_count += 1 + + if merged_count == 0 and len(thing_items) > 0: + _log_warning(info_data, 'All defaults for \'%s\' were skipped, potential redundant config or misconfiguration detected' % (default_type)) + return info_data