From 0aed59c947360b2ddba73a3e02a036eb70308b58 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 30 Jul 2019 19:06:57 +0200 Subject: [PATCH 1/2] Fix unsigned char overflow cause invalid filament load. --- Firmware/mmu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 21ce96d7..d6e533df 100755 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -978,7 +978,7 @@ void extr_adj(uint8_t extruder) //loading filament for SNMM { #ifndef SNMM MmuCmd cmd = MmuCmd::L0 + extruder; - if (cmd > MmuCmd::L4) + if (extruder > (MmuCmd::L4 - MmuCmd::L0)) { printf_P(PSTR("Filament out of range %d \n"),extruder); return; From bca0fd81eb6971909aee6a0c4305926e16c381e3 Mon Sep 17 00:00:00 2001 From: Marek Bel Date: Tue, 30 Jul 2019 19:15:33 +0200 Subject: [PATCH 2/2] Fix loading filament 255 instead of 0 in first layer calibration wizard. --- Firmware/ultralcd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Firmware/ultralcd.cpp b/Firmware/ultralcd.cpp index acb369d9..6b388054 100755 --- a/Firmware/ultralcd.cpp +++ b/Firmware/ultralcd.cpp @@ -4798,6 +4798,7 @@ static void lcd_wizard_load() if (mmu_enabled) { lcd_show_fullscreen_message_and_wait_P(_i("Please insert PLA filament to the first tube of MMU, then press the knob to load it."));////c=20 r=8 + tmp_extruder = 0; } else {