diff --git a/macros/base/cancel_print.cfg b/macros/base/cancel_print.cfg index aa5a9f1f0..00514a448 100644 --- a/macros/base/cancel_print.cfg +++ b/macros/base/cancel_print.cfg @@ -10,6 +10,7 @@ gcode: {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set status_leds_enabled = printer["gcode_macro _USER_VARIABLES"].status_leds_enabled %} {% set bed_mesh_enabled = printer["gcode_macro _USER_VARIABLES"].bed_mesh_enabled %} + {% set filter_default_time = printer["gcode_macro _USER_VARIABLES"].filter_default_time_on_end_print|default(600)|int %} PARK @@ -41,8 +42,14 @@ gcode: SDCARD_RESET_FILE + # If a filter is connected, and used during the print, continue filtering the air + # for a couple of min before stopping everything {% if filter_enabled %} - STOP_FILTER + {% if printer['fan_generic filter'].speed > 0 %} + {% set FILTER_TIME = params.FILTER_TIME|default(filter_default_time)|int %} + START_FILTER SPEED=1 + UPDATE_DELAYED_GCODE ID=_STOP_FILTER_DELAYED DURATION={FILTER_TIME} + {% endif %} {% endif %} {% if light_enabled %}