1
0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2024-11-29 23:07:42 +00:00

🔨 Improve runout script check

This commit is contained in:
Scott Lahteine 2023-04-13 04:06:35 -05:00
parent b3198ed929
commit c8cb618fac

View File

@ -129,8 +129,10 @@ if pioutil.is_pio_build():
#
if 'FILAMENT_RUNOUT_SENSOR' in env['MARLIN_FEATURES'] and 'NUM_RUNOUT_SENSORS' in env['MARLIN_FEATURES']:
if env['MARLIN_FEATURES']['NUM_RUNOUT_SENSORS'].isdigit() and int(env['MARLIN_FEATURES']['NUM_RUNOUT_SENSORS']) > 1:
if 'FILAMENT_RUNOUT_SCRIPT' in env['MARLIN_FEATURES'] and "%c" not in env['MARLIN_FEATURES']['FILAMENT_RUNOUT_SCRIPT']:
err = "ERROR: FILAMENT_RUNOUT_SCRIPT needs a %c parameter when NUM_RUNOUT_SENSORS is > 1"
raise SystemExit(err)
if 'FILAMENT_RUNOUT_SCRIPT' in env['MARLIN_FEATURES']:
frs = env['MARLIN_FEATURES']['FILAMENT_RUNOUT_SCRIPT']
if "M600" in frs and "%c" not in frs:
err = "ERROR: FILAMENT_RUNOUT_SCRIPT needs a %c parameter (e.g., \"M600 T%c\") when NUM_RUNOUT_SENSORS is > 1"
raise SystemExit(err)
sanity_check_target()