diff --git a/Marlin/src/feature/runout.cpp b/Marlin/src/feature/runout.cpp index b34e87ca5e81..e442718dde4e 100644 --- a/Marlin/src/feature/runout.cpp +++ b/Marlin/src/feature/runout.cpp @@ -47,7 +47,7 @@ bool FilamentMonitorBase::enabled = true, #if HAS_FILAMENT_RUNOUT_DISTANCE float RunoutResponseDelayed::runout_distance_mm = FILAMENT_RUNOUT_DISTANCE_MM; - volatile countdown_t RunoutResponseDelayed::mm_countdown; + countdown_t RunoutResponseDelayed::mm_countdown; #if ENABLED(FILAMENT_MOTION_SENSOR) uint8_t FilamentSensorEncoder::motion_detected; #endif @@ -101,15 +101,16 @@ void event_filament_runout(const uint8_t extruder) { const bool run_runout_script = !runout.host_handling; - const bool park_or_pause = (false - #ifdef FILAMENT_RUNOUT_SCRIPT - || strstr(FILAMENT_RUNOUT_SCRIPT, "M600") - || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") - || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25")) - #endif - ); - #if ENABLED(HOST_ACTION_COMMANDS) + + const bool park_or_pause = (false + #ifdef FILAMENT_RUNOUT_SCRIPT + || strstr(FILAMENT_RUNOUT_SCRIPT, "M600") + || strstr(FILAMENT_RUNOUT_SCRIPT, "M125") + || TERN0(ADVANCED_PAUSE_FEATURE, strstr(FILAMENT_RUNOUT_SCRIPT, "M25")) + #endif + ); + if (run_runout_script && park_or_pause) { hostui.paused(false); } diff --git a/Marlin/src/feature/runout.h b/Marlin/src/feature/runout.h index 92fe4932a5b0..d698c4bf58e3 100644 --- a/Marlin/src/feature/runout.h +++ b/Marlin/src/feature/runout.h @@ -50,7 +50,13 @@ #define HAS_FILAMENT_SWITCH 1 #endif -typedef Flags<8> runout_flags_t; +typedef Flags< + #if NUM_MOTION_SENSORS > NUM_RUNOUT_SENSORS + NUM_MOTION_SENSORS + #else + NUM_RUNOUT_SENSORS + #endif + > runout_flags_t; void event_filament_runout(const uint8_t extruder); @@ -352,7 +358,7 @@ class FilamentSensorBase { // during a runout condition. class RunoutResponseDelayed { private: - static volatile countdown_t mm_countdown; + static countdown_t mm_countdown; public: static float runout_distance_mm;