From 52c090dfbe92514fc2a48951583d50da59b819a4 Mon Sep 17 00:00:00 2001 From: Victor Oliveira Date: Fri, 16 Oct 2020 22:05:45 -0300 Subject: [PATCH] Fix starting fan with bad material preset index (#19773) --- Marlin/src/lcd/menu/menu_temperature.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_temperature.cpp b/Marlin/src/lcd/menu/menu_temperature.cpp index 0c70cd7e1..edf6685d7 100644 --- a/Marlin/src/lcd/menu/menu_temperature.cpp +++ b/Marlin/src/lcd/menu/menu_temperature.cpp @@ -44,24 +44,17 @@ // void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t indb) { + UNUSED(e); UNUSED(indh); UNUSED(indb); #if HAS_HOTEND if (indh >= 0 && ui.material_preset[indh].hotend_temp > 0) setTargetHotend(_MIN(thermalManager.heater_maxtemp[e] - HOTEND_OVERSHOOT, ui.material_preset[indh].hotend_temp), e); - #else - UNUSED(e); UNUSED(indh); #endif #if HAS_HEATED_BED if (indb >= 0 && ui.material_preset[indb].bed_temp > 0) setTargetBed(ui.material_preset[indb].bed_temp); - #else - UNUSED(indb); #endif #if HAS_FAN - set_fan_speed(( - #if FAN_COUNT > 1 - active_extruder < FAN_COUNT ? active_extruder : - #endif - 0), ui.material_preset[indh].fan_speed - ); + if (indh >= 0) + set_fan_speed(active_extruder < (FAN_COUNT) ? active_extruder : 0, ui.material_preset[indh].fan_speed); #endif ui.return_to_status(); } @@ -93,7 +86,9 @@ void Temperature::lcd_preheat(const int16_t e, const int8_t indh, const int8_t i #endif - void do_preheat_end_m() { _preheat_end(editable.int8, 0); } + void do_preheat_end_m() { + _preheat_end(editable.int8, 0); + } #if HAS_MULTI_HOTEND || HAS_HEATED_BED