Skip to content

Commit d80c508

Browse files
committed
pause: Fix infinite loop in filament stuck logic with MMU
When the filament is stuck on a printer with MMU (e.g. MK4S), the firmware would enter an infinite loop in the pause state machine because 'LoadType::filament_stuck' was not handled in 'mmu_unload_start_process'. This change adds the missing case to allow the MMU to unload and eject the stuck filament.
1 parent b91eeda commit d80c508

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/marlin_stubs/pause/pause.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ void Pause::mmu_load_start_process([[maybe_unused]] Response response) {
714714

715715
setPhase(PhasesLoadUnload::IsColor);
716716
set(LoadState::color_correct_ask);
717-
} else if (load_type == LoadType::filament_change) {
717+
} else if (load_type == LoadType::filament_change || load_type == LoadType::filament_stuck) {
718718
if (settings.mmu_filament_to_load == MMU2::FILAMENT_UNKNOWN) {
719719
set(LoadState::load_prime);
720720
return;
@@ -750,7 +750,7 @@ void Pause::mmu_unload_start_process([[maybe_unused]] Response response) {
750750
if (load_type == LoadType::unload) {
751751
MMU2::mmu2.unload();
752752
set(LoadState::_finished);
753-
} else if (load_type == LoadType::filament_change) {
753+
} else if (load_type == LoadType::filament_change || load_type == LoadType::filament_stuck) {
754754
settings.mmu_filament_to_load = MMU2::mmu2.get_current_tool();
755755

756756
// No filament loaded in MMU, we can't continue, as we don't know what slot to load

0 commit comments

Comments
 (0)