diff --git a/Firmware/Marlin.h b/Firmware/Marlin.h index 475051669..eb048dd25 100755 --- a/Firmware/Marlin.h +++ b/Firmware/Marlin.h @@ -414,6 +414,7 @@ extern void print_physical_coordinates(); extern void print_mesh_bed_leveling_table(); extern void stop_and_save_print_to_ram(float z_move, float e_move); +void restore_extruder_temperture_from_ram(); extern void restore_print_from_ram_and_continue(float e_move); extern void cancel_saved_printing(); diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index d27bca47b..c9a71fab4 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -11172,6 +11172,16 @@ void stop_and_save_print_to_ram(float z_move, float e_move) } } +void restore_extruder_temperture_from_ram() { + if (degTargetHotend(saved_active_extruder) != saved_extruder_temperature) + { + setTargetHotendSafe(saved_extruder_temperature, saved_active_extruder); + heating_status = HeatingStatus::EXTRUDER_HEATING; + wait_for_heater(_millis(), saved_active_extruder); + heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; + } +} + //! @brief Restore print from ram //! //! Restore print saved by stop_and_save_print_to_ram(). Is blocking, restores @@ -11198,13 +11208,7 @@ void restore_print_from_ram_and_continue(float e_move) // restore active_extruder active_extruder = saved_active_extruder; fanSpeed = saved_fan_speed; - if (degTargetHotend(saved_active_extruder) != saved_extruder_temperature) - { - setTargetHotendSafe(saved_extruder_temperature, saved_active_extruder); - heating_status = HeatingStatus::EXTRUDER_HEATING; - wait_for_heater(_millis(), saved_active_extruder); - heating_status = HeatingStatus::EXTRUDER_HEATING_COMPLETE; - } + restore_extruder_temperture_from_ram(); axis_relative_modes ^= (-saved_extruder_relative_mode ^ axis_relative_modes) & E_AXIS_MASK; float e = saved_pos[E_AXIS] - e_move; plan_set_e_position(e); diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index 104597797..2b75e383e 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -6005,7 +6005,18 @@ void print_stop() fanSpeed = 0; } - if (MMU2::mmu2.Enabled()) MMU2::mmu2.unload(); //M702 C + if (MMU2::mmu2.Enabled()) + { + if (isPrintPaused) + { + // Restore temperature saved in ram after pausing print + restore_extruder_temperture_from_ram(); + } + MMU2::mmu2.unload(); //M702 C + } + + lcd_cooldown(); //turns off heaters and fan; goes to status screen. + finishAndDisableSteppers(); //M84 axis_relative_modes = E_AXIS_MASK; //XYZ absolute, E relative }