diff --git a/macros/base/pause_resume.cfg b/macros/base/pause_resume.cfg index 22b76887..4fbcdad1 100644 --- a/macros/base/pause_resume.cfg +++ b/macros/base/pause_resume.cfg @@ -4,6 +4,7 @@ description: Pause the print and park gcode: {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set light_intensity_start_print = printer["gcode_macro _USER_VARIABLES"].light_intensity_start_print %} + {% set turn_off_extruder = printer["gcode_macro _USER_VARIABLES"].turn_off_extruder_on_pause %} {% if printer.pause_resume.is_paused %} RESPOND MSG="Print is already paused" @@ -12,19 +13,27 @@ gcode: {% if light_enabled %} LIGHT_ON S={light_intensity_start_print} {% endif %} + BASE_PAUSE PARK + + {% if turn_off_extruder %} + SET_GCODE_VARIABLE MACRO=RESUME VARIABLE=extruder_target_temp VALUE={printer.extruder.target} + M104 S0 + {% endif %} {% endif %} [gcode_macro RESUME] rename_existing: BASE_RESUME description: Resume the print after an optional unretract +variable_extruder_target_temp: 0 gcode: {% set St = printer["gcode_macro _USER_VARIABLES"].travel_speed %} {% set light_enabled = printer["gcode_macro _USER_VARIABLES"].light_enabled %} {% set light_intensity_printing = printer["gcode_macro _USER_VARIABLES"].light_intensity_printing %} {% set klippain_mmu_enabled = printer["gcode_macro _USER_VARIABLES"].klippain_mmu_enabled %} + {% set turn_off_extruder = printer["gcode_macro _USER_VARIABLES"].turn_off_extruder_on_pause %} {% if not printer.pause_resume.is_paused %} RESPOND MSG="Print is not paused. Resume ignored" @@ -38,9 +47,15 @@ gcode: {% else %} RESTORE_GCODE_STATE NAME=PAUSE_state MOVE=1 MOVE_SPEED={St} {% endif %} + {% if light_enabled %} LIGHT_ON S={light_intensity_printing} {% endif %} + + {% if turn_off_extruder and extruder_target_temp > 0 %} + M109 S{extruder_target_temp|int} + {% endif %} + BASE_RESUME {% endif %} diff --git a/user_templates/variables.cfg b/user_templates/variables.cfg index 67f2e2cb..1f105033 100644 --- a/user_templates/variables.cfg +++ b/user_templates/variables.cfg @@ -21,9 +21,9 @@ variable_brush_clean_accel: 1500 variable_probe_dock_accel: 2000 -################################################# -# Homing, start_print and end_print variables -################################################# +##################################################### +# Homing, start_print, end_print and pause variables +##################################################### ## Physical Z endstop pin position. This variable is used only if ## you don't use the automatic z_calibration plugin: if this plugin is @@ -71,6 +71,9 @@ variable_disable_motors_in_end_print: False ## Automatically turn-off heaters in the END_PRINT macro variable_turn_off_heaters_in_end_print: True +## Automatically turn-off the extruder/hotend when a print job is paused +variable_turn_off_extruder_on_pause: False + ## Automatically reset velocity limits to configured values in the END_PRINT macro variable_reset_velocity_limits_in_end_print: True