From c8cb618faca2ec88681dfdd1b36ab6d160036b33 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 13 Apr 2023 04:06:35 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20Improve=20runout=20script=20chec?= =?UTF-8?q?k?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buildroot/share/PlatformIO/scripts/preflight-checks.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/buildroot/share/PlatformIO/scripts/preflight-checks.py b/buildroot/share/PlatformIO/scripts/preflight-checks.py index 08856350d2..3f7c97af9d 100644 --- a/buildroot/share/PlatformIO/scripts/preflight-checks.py +++ b/buildroot/share/PlatformIO/scripts/preflight-checks.py @@ -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()