Skip to content

Commit

Permalink
👷 resume_print params for timeout, filament load
Browse files Browse the repository at this point in the history
Co-Authored-By: Erkan Ozgur Yilmaz <1786804+eoyilmaz@users.noreply.github.com>
  • Loading branch information
thinkyhead and eoyilmaz committed Aug 20, 2024
1 parent 0cd9643 commit b8e2ad9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
26 changes: 22 additions & 4 deletions Marlin/src/feature/pause.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,27 @@ void wait_for_confirmation(const bool is_reload/*=false*/, const int8_t max_beep
* - Send host action for resume, if configured
* - Resume the current SD print job, if any
*/
void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_length/*=0*/, const_float_t purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/, const int8_t max_beep_count/*=0*/, const celsius_t targetTemp/*=0*/ DXC_ARGS) {
void resume_print(
const_float_t slow_load_length/*=0*/,
const_float_t fast_load_length/*=0*/,
const_float_t purge_length/*=ADVANCED_PAUSE_PURGE_LENGTH*/,
const int8_t max_beep_count/*=0*/,
const celsius_t targetTemp/*=0*/,
const bool show_lcd/*=true*/,
const bool pause_for_user/*=false*/
DXC_ARGS
) {
DEBUG_SECTION(rp, "resume_print", true);
DEBUG_ECHOLNPGM("... slowlen:", slow_load_length, " fastlen:", fast_load_length, " purgelen:", purge_length, " maxbeep:", max_beep_count, " targetTemp:", targetTemp DXC_SAY);
DEBUG_ECHOLNPGM(
"... slowlen:", slow_load_length
, " fastlen:", fast_load_length
, " purgelen:", purge_length
, " maxbeep:", max_beep_count
, " targetTemp:", targetTemp
, " show_lcd:", show_lcd
, " pause_for_user:", pause_for_user
DXC_SAY
);

/*
SERIAL_ECHOLNPGM(
Expand All @@ -627,7 +645,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
if (!did_pause_print) return;

// Re-enable the heaters if they timed out
bool nozzle_timed_out = false;
bool nozzle_timed_out = pause_for_user;
HOTEND_LOOP() {
nozzle_timed_out |= thermalManager.heater_idle[e].timed_out;
thermalManager.reset_hotend_idle_timer(e);
Expand All @@ -637,7 +655,7 @@ void resume_print(const_float_t slow_load_length/*=0*/, const_float_t fast_load_
thermalManager.setTargetHotend(targetTemp, active_extruder);

// Load the new filament
load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, true, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS);
load_filament(slow_load_length, fast_load_length, purge_length, max_beep_count, show_lcd, nozzle_timed_out, PAUSE_MODE_SAME DXC_PASS);

if (targetTemp > 0) {
thermalManager.setTargetHotend(targetTemp, active_extruder);
Expand Down
4 changes: 3 additions & 1 deletion Marlin/src/feature/pause.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ void resume_print(
const_float_t fast_load_length=0, // (mm) Fast Load Length for initial move
const_float_t purge_length=ADVANCED_PAUSE_PURGE_LENGTH, // (mm) Purge length
const int8_t max_beep_count=0, // Beep alert for attention
const celsius_t targetTemp=0 // (°C) A target temperature for the hotend
const celsius_t targetTemp=0, // (°C) A target temperature for the hotend
const bool show_lcd=true, // Set LCD status messages?
const bool pause_for_user=false // Pause for user before returning?
DXC_PARAMS // Dual-X-Carriage extruder index
);

Expand Down

0 comments on commit b8e2ad9

Please sign in to comment.