Browse Source

Remove ADVANCED_PAUSE_FEATURE requirement for PROBING_HEATERS_OFF (#7000)

* Remove ADVANCED_PAUSE_FEATURE requirement for PROBING_HEATERS_OFF

* Add HEATER_IDLE_HANDLER conditional
Thomas Moore 7 years ago
parent
commit
e47029199e

+ 1
- 0
Marlin/Conditionals_post.h View File

653
     #undef PROBING_FANS_OFF
653
     #undef PROBING_FANS_OFF
654
   #endif
654
   #endif
655
   #define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF)))
655
   #define QUIET_PROBING (HAS_BED_PROBE && (ENABLED(PROBING_HEATERS_OFF) || ENABLED(PROBING_FANS_OFF)))
656
+  #define HEATER_IDLE_HANDLER (ENABLED(ADVANCED_PAUSE_FEATURE) || ENABLED(PROBING_HEATERS_OFF))
656
 
657
 
657
   /**
658
   /**
658
    * Servos and probes
659
    * Servos and probes

+ 0
- 7
Marlin/SanityCheck.h View File

577
     #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
577
     #error "Probes need Z_CLEARANCE_BETWEEN_PROBES >= 0."
578
   #endif
578
   #endif
579
 
579
 
580
-   /**
581
-    * Advanced Pause is required in order to turn the heaters off during probing
582
-    */
583
-   #if (ENABLED(PROBING_HEATERS_OFF) && DISABLED(ADVANCED_PAUSE_FEATURE))
584
-     #error "PROBING_HEATERS_OFF requires ADVANCED_PAUSE_FEATURE"
585
-   #endif
586
-
587
 #else
580
 #else
588
 
581
 
589
   /**
582
   /**

+ 9
- 9
Marlin/temperature.cpp View File

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

+ 2
- 2
Marlin/temperature.h View File

262
       static bool paused;
262
       static bool paused;
263
     #endif
263
     #endif
264
 
264
 
265
-    #if ENABLED(ADVANCED_PAUSE_FEATURE)
265
+    #if HEATER_IDLE_HANDLER
266
       static millis_t heater_idle_timeout_ms[HOTENDS];
266
       static millis_t heater_idle_timeout_ms[HOTENDS];
267
       static bool heater_idle_timeout_exceeded[HOTENDS];
267
       static bool heater_idle_timeout_exceeded[HOTENDS];
268
       #if HAS_TEMP_BED
268
       #if HAS_TEMP_BED
476
       static bool is_paused() { return paused; }
476
       static bool is_paused() { return paused; }
477
     #endif
477
     #endif
478
 
478
 
479
-    #if ENABLED(ADVANCED_PAUSE_FEATURE)
479
+    #if HEATER_IDLE_HANDLER
480
       static void start_heater_idle_timer(uint8_t e, millis_t timeout_ms) {
480
       static void start_heater_idle_timer(uint8_t e, millis_t timeout_ms) {
481
         #if HOTENDS == 1
481
         #if HOTENDS == 1
482
           UNUSED(e);
482
           UNUSED(e);

+ 1
- 1
Marlin/ultralcd_impl_DOGM.h View File

357
   #endif
357
   #endif
358
 
358
 
359
   if (PAGE_UNDER(7)) {
359
   if (PAGE_UNDER(7)) {
360
-    #if ENABLED(ADVANCED_PAUSE_FEATURE)
360
+    #if HEATER_IDLE_HANDLER
361
       const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
361
       const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
362
       #if HAS_TEMP_BED
362
       #if HAS_TEMP_BED
363
         thermalManager.is_bed_idle()
363
         thermalManager.is_bed_idle()

+ 1
- 1
Marlin/ultralcd_impl_HD44780.h View File

600
   lcd.print(itostr3(t1 + 0.5));
600
   lcd.print(itostr3(t1 + 0.5));
601
   lcd.print('/');
601
   lcd.print('/');
602
 
602
 
603
-  #if ENABLED(ADVANCED_PAUSE_FEATURE)
603
+  #if HEATER_IDLE_HANDLER
604
     const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
604
     const bool is_idle = (!isBed ? thermalManager.is_heater_idle(heater) :
605
       #if HAS_TEMP_BED
605
       #if HAS_TEMP_BED
606
         thermalManager.is_bed_idle()
606
         thermalManager.is_bed_idle()

Loading…
Cancel
Save