From f9dbd73652b79913032f4cfb4748563bb1ad7242 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 4 Apr 2015 05:25:53 -0700 Subject: [PATCH] Fix tr_target_temperature type - float! --- Marlin/temperature.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 1e3c2b6638..07af7ee752 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1007,7 +1007,7 @@ void setWatch() { void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { - static int tr_target_temperature[EXTRUDERS+1]; + static float tr_target_temperature[EXTRUDERS+1]; /* SERIAL_ECHO_START; @@ -1053,18 +1053,18 @@ void setWatch() { } // If the temperature is over the target (-hysteresis) restart the timer - if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis(); - - // If the timer goes too long without a reset, trigger shutdown + if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) { + *timer = millis(); + } // If the timer goes too long without a reset, trigger shutdown else if (millis() > *timer + period_seconds * 1000UL) { SERIAL_ERROR_START; SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP); if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id); LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY); thermal_runaway = true; + disable_heater(); + disable_all_steppers(); for (;;) { - disable_heater(); - disable_all_steppers(); manage_heater(); lcd_update(); }