From e6f05e78562c9a29f058a2e665e80976ff013f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Sun, 11 Jun 2023 09:42:27 +0000 Subject: [PATCH] PFW-1522 Fix firmware getting stuck on ejecting If slot is unknown, the printer will always get a rejected command error from the MMU. Change in memory: Flash: +4 bytes SRAM: 0 bytes --- Firmware/Marlin_main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 8bb82b565..ad4ffa31c 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3432,11 +3432,13 @@ static void mmu_M600_filament_change_screen(uint8_t eject_slot) { MMU2::mmu2.clearPrinterButtonOperation(); if (btn == MMU2::Buttons::Eject) { - MMU2::mmu2.eject_filament(eject_slot, true); - // The MMU will raise FILAMENT_EJECTED screen, and ask the user to confirm - // the operation is done. We must be careful to not raise FILAMENT_CHANGE - // screen too quickly - continue; + if (eject_slot != (uint8_t)MMU2::FILAMENT_UNKNOWN) { + MMU2::mmu2.eject_filament(eject_slot, true); + // The MMU will raise FILAMENT_EJECTED screen, and ask the user to confirm + // the operation is done. We must be careful to not raise FILAMENT_CHANGE + // screen too quickly + continue; + } } else if (btn == MMU2::Buttons::Load) {