From 9cf1f7871eafe7edca63eaff9e5cd76b38d8c4f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gu=C3=B0ni=20M=C3=A1r=20Gilbert?= Date: Tue, 2 May 2023 22:32:18 +0000 Subject: [PATCH] Minor fix to M701 when MMU slot is out of range If MMU slot is outside of range, then we rather the printer not do anything. Currently it would accidentally assume the MMU is disabled. This may have undesireable results. No change in memory --- Firmware/Marlin_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index 35caf0e90..5c8df63f8 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3575,8 +3575,10 @@ void gcode_M701(float fastLoadLength, uint8_t mmuSlotIndex){ prusa_statistics(22); - if (MMU2::mmu2.Enabled() && mmuSlotIndex < MMU_FILAMENT_COUNT) { - MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); + if (MMU2::mmu2.Enabled()) { + if (mmuSlotIndex < MMU_FILAMENT_COUNT) { + MMU2::mmu2.load_filament_to_nozzle(mmuSlotIndex); + } // else do nothing } else { custom_message_type = CustomMsg::FilamentLoading; lcd_setstatuspgm(_T(MSG_LOADING_FILAMENT));