Skip to content

Commit

Permalink
Merge pull request #4661 from gudnimg/PFW-1557
Browse files Browse the repository at this point in the history
PFW-1557 MMU: Improve unload handling when print is aborted
  • Loading branch information
3d-gussner authored Apr 15, 2024
2 parents 6e40fe0 + 16dfcfe commit e8d5548
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions Firmware/ultralcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5716,23 +5716,26 @@ void lcd_print_stop_finish()

// restore the auto hotend state
hotendDefaultAutoFanState();
}

if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament())
{
// The print was aborted while when the nozzle was cold:
// 1. in a paused state => a partial backup in RAM is always available
// 2. after a recoverable thermal/fan error had paused the print => only extruder temperature is saved to RAM
if (printingIsPaused())
{
// Restore temperature saved in ram after pausing print
restore_extruder_temperature_from_ram();
}
if (MMU2::mmu2.Enabled() && MMU2::mmu2.FindaDetectsFilament()
#ifdef FANCHECK
&& fan_check_error != EFCE_REPORTED
#endif //FANCHECK
) {
// The print was aborted while when the nozzle was cold:
// 1. in a paused state => a partial backup in RAM is always available
// 2. after a recoverable thermal/fan error had paused the print => only extruder temperature is saved to RAM
if (printingIsPaused())
{
// Restore temperature saved in ram after pausing print
restore_extruder_temperature_from_ram();
}

// If the pause state was cleared previously or the target temperature is 0°C in the case
// of an unconditional stop. In that scenario we do not want to unload.
if (target_temperature[0] >= extrude_min_temp) {
MMU2::mmu2.unload(); // M702
// If the pause state was cleared previously or the target temperature is 0°C in the case
// of an unconditional stop. In that scenario we do not want to unload.
if (target_temperature[0] >= extrude_min_temp) {
MMU2::mmu2.unload(); // M702
}
}
}

Expand Down

0 comments on commit e8d5548

Please sign in to comment.