|
@@ -1007,7 +1007,7 @@ void setWatch() {
|
1007
|
1007
|
|
1008
|
1008
|
void thermal_runaway_protection(TRState *state, unsigned long *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
|
1009
|
1009
|
|
1010
|
|
- static int tr_target_temperature[EXTRUDERS+1];
|
|
1010
|
+ static float tr_target_temperature[EXTRUDERS+1];
|
1011
|
1011
|
|
1012
|
1012
|
/*
|
1013
|
1013
|
SERIAL_ECHO_START;
|
|
@@ -1053,18 +1053,18 @@ void setWatch() {
|
1053
|
1053
|
}
|
1054
|
1054
|
|
1055
|
1055
|
// If the temperature is over the target (-hysteresis) restart the timer
|
1056
|
|
- if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) *timer = millis();
|
1057
|
|
-
|
1058
|
|
- // If the timer goes too long without a reset, trigger shutdown
|
|
1056
|
+ if (temperature >= tr_target_temperature[heater_index] - hysteresis_degc) {
|
|
1057
|
+ *timer = millis();
|
|
1058
|
+ } // If the timer goes too long without a reset, trigger shutdown
|
1059
|
1059
|
else if (millis() > *timer + period_seconds * 1000UL) {
|
1060
|
1060
|
SERIAL_ERROR_START;
|
1061
|
1061
|
SERIAL_ERRORLNPGM(MSG_THERMAL_RUNAWAY_STOP);
|
1062
|
1062
|
if (heater_id < 0) SERIAL_ERRORLNPGM("bed"); else SERIAL_ERRORLN(heater_id);
|
1063
|
1063
|
LCD_ALERTMESSAGEPGM(MSG_THERMAL_RUNAWAY);
|
1064
|
1064
|
thermal_runaway = true;
|
|
1065
|
+ disable_heater();
|
|
1066
|
+ disable_all_steppers();
|
1065
|
1067
|
for (;;) {
|
1066
|
|
- disable_heater();
|
1067
|
|
- disable_all_steppers();
|
1068
|
1068
|
manage_heater();
|
1069
|
1069
|
lcd_update();
|
1070
|
1070
|
}
|