Skip to content

Commit

Permalink
Avoid generating empty ENCODER_RESOLUTION (qmk#20179)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored and struckmb committed Apr 10, 2023
1 parent 79be121 commit 0e69a53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/python/qmk/cli/generate/config_h.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ def generate_encoder_config(encoder_json, config_h_lines, postfix=''):
config_h_lines.append(generate_define(f'ENCODERS_PAD_B{postfix}', f'{{ {", ".join(b_pads)} }}'))

if None in resolutions:
cli.log.debug("Unable to generate ENCODER_RESOLUTION configuration")
cli.log.debug(f"Unable to generate ENCODER_RESOLUTION{postfix} configuration")
elif len(resolutions) == 0:
cli.log.debug(f"Skipping ENCODER_RESOLUTION{postfix} configuration")
elif len(set(resolutions)) == 1:
config_h_lines.append(generate_define(f'ENCODER_RESOLUTION{postfix}', resolutions[0]))
else:
Expand Down

0 comments on commit 0e69a53

Please sign in to comment.