From e1c79c342d75191ea759bfbecba00d9a907df7e0 Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 30 Jul 2020 17:14:13 +0200 Subject: [PATCH] Re-introduce redundant disable_heaters() calls Partially revert 285b505c73a54e9af01816e3a614de73ad181851 so that we ensure heaters are disabled ASAP in case of potential bugs in the max_*_error functions. --- Firmware/temperature.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Firmware/temperature.cpp b/Firmware/temperature.cpp index 75d52817e..f9fa48fff 100755 --- a/Firmware/temperature.cpp +++ b/Firmware/temperature.cpp @@ -1452,6 +1452,7 @@ enum { LCDALERT_NONE = 0, LCDALERT_HEATERMINTEMP, LCDALERT_BEDMINTEMP, LCDALERT_ uint8_t last_alert_sent_to_lcd = LCDALERT_NONE; void max_temp_error(uint8_t e) { + disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLN((int)e); @@ -1479,6 +1480,7 @@ void min_temp_error(uint8_t e) { #ifdef DEBUG_DISABLE_MINTEMP return; #endif + disable_heater(); //if (current_temperature_ambient < MINTEMP_MINAMBIENT) return; static const char err[] PROGMEM = "Err: MINTEMP"; if(IsStopped() == false) { @@ -1504,6 +1506,7 @@ void min_temp_error(uint8_t e) { } void bed_max_temp_error(void) { + disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Heaters switched off. MAXTEMP BED triggered !"); @@ -1518,7 +1521,8 @@ void bed_min_temp_error(void) { #ifdef DEBUG_DISABLE_MINTEMP return; #endif - static const char err[] PROGMEM = "Err: MINTEMP BED"; + disable_heater(); + static const char err[] PROGMEM = "MINTEMP BED"; if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Heaters switched off. MINTEMP BED triggered !"); @@ -1537,6 +1541,7 @@ void bed_min_temp_error(void) { #ifdef AMBIENT_THERMISTOR void ambient_max_temp_error(void) { + disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Heaters switched off. MAXTEMP AMBIENT triggered !"); @@ -1551,6 +1556,7 @@ void ambient_min_temp_error(void) { #ifdef DEBUG_DISABLE_MINTEMP return; #endif + disable_heater(); if(IsStopped() == false) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM("Heaters switched off. MINTEMP AMBIENT triggered !");