|
@@ -203,7 +203,7 @@ uint8_t Temperature::soft_pwm_amount[HOTENDS],
|
203
|
203
|
bool Temperature::paused;
|
204
|
204
|
#endif
|
205
|
205
|
|
206
|
|
-#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
206
|
+#if HEATER_IDLE_HANDLER
|
207
|
207
|
millis_t Temperature::heater_idle_timeout_ms[HOTENDS] = { 0 };
|
208
|
208
|
bool Temperature::heater_idle_timeout_exceeded[HOTENDS] = { false };
|
209
|
209
|
#if HAS_TEMP_BED
|
|
@@ -558,7 +558,7 @@ float Temperature::get_pid_output(int e) {
|
558
|
558
|
pid_error[HOTEND_INDEX] = target_temperature[HOTEND_INDEX] - current_temperature[HOTEND_INDEX];
|
559
|
559
|
dTerm[HOTEND_INDEX] = K2 * PID_PARAM(Kd, HOTEND_INDEX) * (current_temperature[HOTEND_INDEX] - temp_dState[HOTEND_INDEX]) + K1 * dTerm[HOTEND_INDEX];
|
560
|
560
|
temp_dState[HOTEND_INDEX] = current_temperature[HOTEND_INDEX];
|
561
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
561
|
+ #if HEATER_IDLE_HANDLER
|
562
|
562
|
if (heater_idle_timeout_exceeded[HOTEND_INDEX]) {
|
563
|
563
|
pid_output = 0;
|
564
|
564
|
pid_reset[HOTEND_INDEX] = true;
|
|
@@ -570,7 +570,7 @@ float Temperature::get_pid_output(int e) {
|
570
|
570
|
pid_reset[HOTEND_INDEX] = true;
|
571
|
571
|
}
|
572
|
572
|
else if (pid_error[HOTEND_INDEX] < -(PID_FUNCTIONAL_RANGE) || target_temperature[HOTEND_INDEX] == 0
|
573
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
573
|
+ #if HEATER_IDLE_HANDLER
|
574
|
574
|
|| heater_idle_timeout_exceeded[HOTEND_INDEX]
|
575
|
575
|
#endif
|
576
|
576
|
) {
|
|
@@ -633,7 +633,7 @@ float Temperature::get_pid_output(int e) {
|
633
|
633
|
#endif // PID_DEBUG
|
634
|
634
|
|
635
|
635
|
#else /* PID off */
|
636
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
636
|
+ #if HEATER_IDLE_HANDLER
|
637
|
637
|
if (heater_idle_timeout_exceeded[HOTEND_INDEX])
|
638
|
638
|
pid_output = 0;
|
639
|
639
|
else
|
|
@@ -719,13 +719,13 @@ void Temperature::manage_heater() {
|
719
|
719
|
if (current_temperature[0] < max(HEATER_0_MINTEMP, MAX6675_TMIN + .01)) min_temp_error(0);
|
720
|
720
|
#endif
|
721
|
721
|
|
722
|
|
- #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
722
|
+ #if WATCH_HOTENDS || WATCH_THE_BED || DISABLED(PIDTEMPBED) || HAS_AUTO_FAN || HEATER_IDLE_HANDLER
|
723
|
723
|
millis_t ms = millis();
|
724
|
724
|
#endif
|
725
|
725
|
|
726
|
726
|
HOTEND_LOOP() {
|
727
|
727
|
|
728
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
728
|
+ #if HEATER_IDLE_HANDLER
|
729
|
729
|
if (!heater_idle_timeout_exceeded[e] && heater_idle_timeout_ms[e] && ELAPSED(ms, heater_idle_timeout_ms[e]))
|
730
|
730
|
heater_idle_timeout_exceeded[e] = true;
|
731
|
731
|
#endif
|
|
@@ -793,7 +793,7 @@ void Temperature::manage_heater() {
|
793
|
793
|
|
794
|
794
|
#if HAS_TEMP_BED
|
795
|
795
|
|
796
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
796
|
+ #if HEATER_IDLE_HANDLER
|
797
|
797
|
if (!bed_idle_timeout_exceeded && bed_idle_timeout_ms && ELAPSED(ms, bed_idle_timeout_ms))
|
798
|
798
|
bed_idle_timeout_exceeded = true;
|
799
|
799
|
#endif
|
|
@@ -802,7 +802,7 @@ void Temperature::manage_heater() {
|
802
|
802
|
thermal_runaway_protection(&thermal_runaway_bed_state_machine, &thermal_runaway_bed_timer, current_temperature_bed, target_temperature_bed, -1, THERMAL_PROTECTION_BED_PERIOD, THERMAL_PROTECTION_BED_HYSTERESIS);
|
803
|
803
|
#endif
|
804
|
804
|
|
805
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
805
|
+ #if HEATER_IDLE_HANDLER
|
806
|
806
|
if (bed_idle_timeout_exceeded)
|
807
|
807
|
{
|
808
|
808
|
soft_pwm_amount_bed = 0;
|
|
@@ -1294,7 +1294,7 @@ void Temperature::init() {
|
1294
|
1294
|
|
1295
|
1295
|
int heater_index = heater_id >= 0 ? heater_id : HOTENDS;
|
1296
|
1296
|
|
1297
|
|
- #if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
1297
|
+ #if HEATER_IDLE_HANDLER
|
1298
|
1298
|
// If the heater idle timeout expires, restart
|
1299
|
1299
|
if (heater_id >= 0 && heater_idle_timeout_exceeded[heater_id]) {
|
1300
|
1300
|
*state = TRInactive;
|