Don't start watching heaters when target is 0 (#12453)

This commit is contained in:
Giuliano Zaro 2018-11-18 04:53:52 +01:00 committed by Scott Lahteine
parent 93e958f695
commit d3605cfc26

View File

@ -1436,7 +1436,7 @@ void Temperature::init() {
#if HOTENDS == 1 #if HOTENDS == 1
UNUSED(e); UNUSED(e);
#endif #endif
if (degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) { if (degTargetHotend(HOTEND_INDEX) && degHotend(HOTEND_INDEX) < degTargetHotend(HOTEND_INDEX) - (WATCH_TEMP_INCREASE + TEMP_HYSTERESIS + 1)) {
watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE; watch_target_temp[HOTEND_INDEX] = degHotend(HOTEND_INDEX) + WATCH_TEMP_INCREASE;
watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL; watch_heater_next_ms[HOTEND_INDEX] = millis() + (WATCH_TEMP_PERIOD) * 1000UL;
} }
@ -1452,7 +1452,7 @@ void Temperature::init() {
* This is called when the temperature is set. (M140, M190) * This is called when the temperature is set. (M140, M190)
*/ */
void Temperature::start_watching_bed() { void Temperature::start_watching_bed() {
if (degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) { if (degTargetBed() && degBed() < degTargetBed() - (WATCH_BED_TEMP_INCREASE + TEMP_BED_HYSTERESIS + 1)) {
watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE; watch_target_bed_temp = degBed() + WATCH_BED_TEMP_INCREASE;
watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL; watch_bed_next_ms = millis() + (WATCH_BED_TEMP_PERIOD) * 1000UL;
} }