Commit f5e7693c authored by Simone Primarosa's avatar Simone Primarosa

Reverse thermal runway enhancement

This feature was already better implemented in start_watching_heater
parent f1c2ada5
...@@ -1119,7 +1119,6 @@ void tp_init() { ...@@ -1119,7 +1119,6 @@ void tp_init() {
#if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED) #if ENABLED(THERMAL_PROTECTION_HOTENDS) || ENABLED(THERMAL_PROTECTION_BED)
void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) { void thermal_runaway_protection(TRState *state, millis_t *timer, float temperature, float target_temperature, int heater_id, int period_seconds, int hysteresis_degc) {
static float tr_last_temperature = 0.0;
static float tr_target_temperature[HOTENDS + 1] = { 0.0 }; static float tr_target_temperature[HOTENDS + 1] = { 0.0 };
/* /*
ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: "); ECHO_SM(DB, "Thermal Thermal Runaway Running. Heater ID: ");
...@@ -1144,7 +1143,6 @@ void tp_init() { ...@@ -1144,7 +1143,6 @@ void tp_init() {
// Inactive state waits for a target temperature to be set // Inactive state waits for a target temperature to be set
case TRInactive: { case TRInactive: {
if (target_temperature > 0) { if (target_temperature > 0) {
tr_last_temperature = temperature;
tr_target_temperature[heater_index] = target_temperature; tr_target_temperature[heater_index] = target_temperature;
*timer = millis(); *timer = millis();
*state = TRFirstHeating; *state = TRFirstHeating;
...@@ -1155,11 +1153,6 @@ void tp_init() { ...@@ -1155,11 +1153,6 @@ void tp_init() {
// If the heater takes too long to reach the target temperature the sistem will be halt. // If the heater takes too long to reach the target temperature the sistem will be halt.
case TRFirstHeating: { case TRFirstHeating: {
if (temperature >= tr_target_temperature[heater_index]) *state = TRStable; if (temperature >= tr_target_temperature[heater_index]) *state = TRStable;
else if (temperature == tr_last_temperature) {
if (millis() > *timer + period_seconds * 1000UL) {
*state = TRRunaway;
}
}
else { else {
*timer = millis(); *timer = millis();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment