Skip to content

Commit

Permalink
Fix rgbkb/sol/rev2 build issues (#17601)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Jul 8, 2022
1 parent b0c3d61 commit 81d317a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/python/qmk/c_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ def _parse_led_config(file, matrix_cols, matrix_rows):
position_raw.append(_coerce_led_token(_type, value))
if section == 3 and bracket_count == 2:
flags.append(_coerce_led_token(_type, value))
elif _type in [Token.Comment.Preproc]:
# TODO: Promote to error
return None

# Slightly better intrim format
matrix = list(_get_chunks(matrix_raw, matrix_cols))
Expand Down
11 changes: 8 additions & 3 deletions lib/python/qmk/cli/generate/config_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,14 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''):
config_h_lines.append(f'# define ENCODERS_PAD_B{postfix} {{ { ", ".join(b_pads) } }}')
config_h_lines.append(f'#endif // ENCODERS_PAD_B{postfix}')

config_h_lines.append(f'#ifndef ENCODER_RESOLUTIONS{postfix}')
config_h_lines.append(f'# define ENCODER_RESOLUTIONS{postfix} {{ { ", ".join(resolutions) } }}')
config_h_lines.append(f'#endif // ENCODER_RESOLUTIONS{postfix}')
if len(set(resolutions)) == 1:
config_h_lines.append(f'#ifndef ENCODER_RESOLUTION{postfix}')
config_h_lines.append(f'# define ENCODER_RESOLUTION{postfix} { resolutions[0] }')
config_h_lines.append(f'#endif // ENCODER_RESOLUTION{postfix}')
else:
config_h_lines.append(f'#ifndef ENCODER_RESOLUTIONS{postfix}')
config_h_lines.append(f'# define ENCODER_RESOLUTIONS{postfix} {{ { ", ".join(resolutions) } }}')
config_h_lines.append(f'#endif // ENCODER_RESOLUTIONS{postfix}')


def generate_split_config(kb_info_json, config_h_lines):
Expand Down

0 comments on commit 81d317a

Please sign in to comment.