From d80c508a5c3bbfd717f8592c96433ed511bd33a0 Mon Sep 17 00:00:00 2001 From: Matthias Bilger Date: Mon, 12 Jan 2026 20:52:41 +0100 Subject: [PATCH] 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. --- src/marlin_stubs/pause/pause.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/marlin_stubs/pause/pause.cpp b/src/marlin_stubs/pause/pause.cpp index cbb3149408..b24b0631be 100644 --- a/src/marlin_stubs/pause/pause.cpp +++ b/src/marlin_stubs/pause/pause.cpp @@ -714,7 +714,7 @@ void Pause::mmu_load_start_process([[maybe_unused]] Response response) { setPhase(PhasesLoadUnload::IsColor); set(LoadState::color_correct_ask); - } else if (load_type == LoadType::filament_change) { + } else if (load_type == LoadType::filament_change || load_type == LoadType::filament_stuck) { if (settings.mmu_filament_to_load == MMU2::FILAMENT_UNKNOWN) { set(LoadState::load_prime); return; @@ -750,7 +750,7 @@ void Pause::mmu_unload_start_process([[maybe_unused]] Response response) { if (load_type == LoadType::unload) { MMU2::mmu2.unload(); set(LoadState::_finished); - } else if (load_type == LoadType::filament_change) { + } else if (load_type == LoadType::filament_change || load_type == LoadType::filament_stuck) { settings.mmu_filament_to_load = MMU2::mmu2.get_current_tool(); // No filament loaded in MMU, we can't continue, as we don't know what slot to load