Skip to content

Commit c8cb618

Browse files
committed
🔨 Improve runout script check
1 parent b3198ed commit c8cb618

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

buildroot/share/PlatformIO/scripts/preflight-checks.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ def rm_ofile(subdir, name):
129129
#
130130
if 'FILAMENT_RUNOUT_SENSOR' in env['MARLIN_FEATURES'] and 'NUM_RUNOUT_SENSORS' in env['MARLIN_FEATURES']:
131131
if env['MARLIN_FEATURES']['NUM_RUNOUT_SENSORS'].isdigit() and int(env['MARLIN_FEATURES']['NUM_RUNOUT_SENSORS']) > 1:
132-
if 'FILAMENT_RUNOUT_SCRIPT' in env['MARLIN_FEATURES'] and "%c" not in env['MARLIN_FEATURES']['FILAMENT_RUNOUT_SCRIPT']:
133-
err = "ERROR: FILAMENT_RUNOUT_SCRIPT needs a %c parameter when NUM_RUNOUT_SENSORS is > 1"
134-
raise SystemExit(err)
132+
if 'FILAMENT_RUNOUT_SCRIPT' in env['MARLIN_FEATURES']:
133+
frs = env['MARLIN_FEATURES']['FILAMENT_RUNOUT_SCRIPT']
134+
if "M600" in frs and "%c" not in frs:
135+
err = "ERROR: FILAMENT_RUNOUT_SCRIPT needs a %c parameter (e.g., \"M600 T%c\") when NUM_RUNOUT_SENSORS is > 1"
136+
raise SystemExit(err)
135137

136138
sanity_check_target()

0 commit comments

Comments
 (0)