|
|
|
|
2887
|
|
2887
|
|
2888
|
if (!residency_start_ms) {
|
2888
|
if (!residency_start_ms) {
|
2889
|
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
|
2889
|
// Start the TEMP_BED_RESIDENCY_TIME timer when we reach target temp for the first time.
|
2890
|
- if (temp_diff < TEMP_BED_WINDOW) residency_start_ms = now;
|
|
|
2891
|
- if (first_loop) residency_start_ms += (TEMP_BED_RESIDENCY_TIME) * 1000UL;
|
|
|
|
|
2890
|
+ if (temp_diff < TEMP_BED_WINDOW) {
|
|
|
2891
|
+ residency_start_ms = now;
|
|
|
2892
|
+ if (first_loop) residency_start_ms += (TEMP_BED_RESIDENCY_TIME) * 1000UL;
|
|
|
2893
|
+ }
|
2892
|
}
|
2894
|
}
|
2893
|
else if (temp_diff > TEMP_BED_HYSTERESIS) {
|
2895
|
else if (temp_diff > TEMP_BED_HYSTERESIS) {
|
2894
|
// Restart the timer whenever the temperature falls outside the hysteresis.
|
2896
|
// Restart the timer whenever the temperature falls outside the hysteresis.
|