Skip to content

Commit

Permalink
mmu3: skip unloading filament on early abort
Browse files Browse the repository at this point in the history
checks if filament is loaded before queuing M702

fixes #3955
  • Loading branch information
krx authored and danopernis committed Jun 6, 2024
1 parent b1b77f6 commit 024103c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/common/marlin_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,9 @@ void print_fan_spd() {
/// can do this since this will be only called at the end of the print or when aborting.
/// So it shouldn't overwrite any important gcodes.
void safely_unload_filament_from_nozzle_to_mmu() {
if (MMU2::WhereIsFilament() == MMU2::FilamentState::NOT_PRESENT) {
return; // no filament loaded, nothing to do
}
const auto original_temp = thermalManager.degTargetHotend(active_extruder);
enqueue_gcode("M702 W2");
enqueue_gcode_printf("M104 S%i", original_temp);
Expand Down

0 comments on commit 024103c

Please sign in to comment.