TEMP_RESIDENCY now in units of 10ms rather than next_read_time
Signed-off-by: Michael Moon <triffid.hunter@gmail.com>
This commit is contained in:
parent
7a57b69cc1
commit
03cebb5a82
21
temp.c
21
temp.c
|
|
@ -271,18 +271,17 @@ void temp_sensor_tick() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
temp_sensors_runtime[i].last_read_temp = temp;
|
temp_sensors_runtime[i].last_read_temp = temp;
|
||||||
|
}
|
||||||
|
if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) {
|
||||||
|
if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100))
|
||||||
|
temp_sensors_runtime[i].temp_residency++;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
temp_sensors_runtime[i].temp_residency = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (labs((int16_t)(temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) {
|
if (temp_sensors[i].heater < NUM_HEATERS) {
|
||||||
if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100))
|
heater_tick(temp_sensors[i].heater, i, temp_sensors_runtime[i].last_read_temp, temp_sensors_runtime[i].target_temp);
|
||||||
temp_sensors_runtime[i].temp_residency++;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
temp_sensors_runtime[i].temp_residency = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (temp_sensors[i].heater < NUM_HEATERS) {
|
|
||||||
heater_tick(temp_sensors[i].heater, i, temp_sensors_runtime[i].last_read_temp, temp_sensors_runtime[i].target_temp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue