Fix starting fan with bad material preset index (#19773)

This commit is contained in:
Victor Oliveira 2020-10-16 22:05:45 -03:00 committed by Scott Lahteine
parent 141f6825ce
commit 52c090dfbe

View File

@ -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