Skip to content

Commit

Permalink
Merge branch 'qmk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hen-des authored Dec 27, 2024
2 parents 13e732e + f549948 commit 7639d64
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
4 changes: 2 additions & 2 deletions keyboards/tzarc/djinn/graphics/theme_djinn_default.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ static painter_font_handle_t thintel;
enum {
RGB_MATRIX_EFFECT_NONE,
# include "rgb_matrix_effects.inc"
# undef RGB_MATRIX_EFFECT
# ifdef RGB_MATRIX_CUSTOM_KB
# include "rgb_matrix_kb.inc"
# endif
# ifdef RGB_MATRIX_CUSTOM_USER
# include "rgb_matrix_user.inc"
# endif
# undef RGB_MATRIX_EFFECT
};

# define RGB_MATRIX_EFFECT(x) \
Expand All @@ -60,13 +60,13 @@ const char *rgb_matrix_name(uint8_t effect) {
case RGB_MATRIX_EFFECT_NONE:
return "NONE";
# include "rgb_matrix_effects.inc"
# undef RGB_MATRIX_EFFECT
# ifdef RGB_MATRIX_CUSTOM_KB
# include "rgb_matrix_kb.inc"
# endif
# ifdef RGB_MATRIX_CUSTOM_USER
# include "rgb_matrix_user.inc"
# endif
# undef RGB_MATRIX_EFFECT
default:
return "UNKNOWN";
}
Expand Down
27 changes: 14 additions & 13 deletions lib/python/qmk/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down

0 comments on commit 7639d64

Please sign in to comment.