aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorQMK Bot <[email protected]>2024-12-27 19:43:49 +0000
committerQMK Bot <[email protected]>2024-12-27 19:43:49 +0000
commit92534d8e3d6f27bda652b7ba78a434eac1d2882f (patch)
tree6689ad470f6b06e46448c1aeb78e2b4d27e35ec8 /lib
parent4d3d8887e798bc25604a734e248278e9a3ccef49 (diff)
parentf549948bbd2a2026875faab1f67ba7b8d21bb5a6 (diff)
downloadqmk_firmware-92534d8e3d6f27bda652b7ba78a434eac1d2882f.tar.gz
qmk_firmware-92534d8e3d6f27bda652b7ba78a434eac1d2882f.zip
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib')
-rw-r--r--lib/python/qmk/info.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/python/qmk/info.py b/lib/python/qmk/info.py
index 74a62721a3..acf8da984f 100644
--- a/lib/python/qmk/info.py
+++ b/lib/python/qmk/info.py
@@ -773,23 +773,24 @@ def find_keyboard_c(keyboard):
def _extract_led_config(info_data, keyboard):
"""Scan all <keyboard>.c files for led config
"""
- cols = info_data['matrix_size']['cols']
- rows = info_data['matrix_size']['rows']
-
for feature in ['rgb_matrix', 'led_matrix']:
if info_data.get('features', {}).get(feature, False) or feature in info_data:
-
# Only attempt search if dd led config is missing
if 'layout' not in info_data.get(feature, {}):
- # Process
- for file in find_keyboard_c(keyboard):
- try:
- ret = find_led_config(file, cols, rows)
- if ret:
- info_data[feature] = info_data.get(feature, {})
- info_data[feature]['layout'] = ret
- except Exception as e:
- _log_warning(info_data, f'led_config: {file.name}: {e}')
+ cols = info_data.get('matrix_size', {}).get('cols')
+ rows = info_data.get('matrix_size', {}).get('rows')
+ if cols and rows:
+ # Process
+ for file in find_keyboard_c(keyboard):
+ try:
+ ret = find_led_config(file, cols, rows)
+ if ret:
+ info_data[feature] = info_data.get(feature, {})
+ info_data[feature]['layout'] = ret
+ except Exception as e:
+ _log_warning(info_data, f'led_config: {file.name}: {e}')
+ else:
+ _log_warning(info_data, 'led_config: matrix size required to parse g_led_config')
if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None):
info_data[feature]['led_count'] = len(info_data[feature]['layout'])