diff options
author | Joel Challis <git@zvecr.com> | 2022-07-08 22:48:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 22:48:48 +0100 |
commit | 81d317aa8768fe53a6cca040297231278b06af64 (patch) | |
tree | 7c96b2aee289b577879cbcab404c8eed933481be /lib/python/qmk/cli/generate | |
parent | b0c3d61c171886aab0b0052a4352e6befc5ce87a (diff) |
Fix rgbkb/sol/rev2 build issues (#17601)
Diffstat (limited to 'lib/python/qmk/cli/generate')
-rwxr-xr-x | lib/python/qmk/cli/generate/config_h.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/python/qmk/cli/generate/config_h.py b/lib/python/qmk/cli/generate/config_h.py index 9d50368aba..b53f4ff335 100755 --- a/lib/python/qmk/cli/generate/config_h.py +++ b/lib/python/qmk/cli/generate/config_h.py @@ -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): |