Avoid generating empty ENCODER_RESOLUTION (#20179)

This commit is contained in:
Joel Challis 2023-04-07 14:07:59 +01:00 committed by GitHub
parent df7b56e0ea
commit e9b36bebb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -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: