Fix tr_target_temperature type - float!

This commit is contained in:
Scott Lahteine 2015-04-04 05:25:53 -07:00
parent 61f8394361
commit f9dbd73652

View file

@ -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();
}