Browse Source

Only watch the heater that was set

Scott Lahteine 10 years ago
parent
commit
9b3d4380d3
4 changed files with 12 additions and 14 deletions
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 8
    10
      Marlin/temperature.cpp
  3. 1
    1
      Marlin/temperature.h
  4. 1
    1
      Marlin/ultralcd.cpp

+ 2
- 2
Marlin/Marlin_main.cpp View File

3168
     #endif
3168
     #endif
3169
 
3169
 
3170
     #ifdef WATCH_TEMP_PERIOD
3170
     #ifdef WATCH_TEMP_PERIOD
3171
-      start_watching_heaters();
3171
+      start_watching_heater(target_extruder);
3172
     #endif
3172
     #endif
3173
   }
3173
   }
3174
 }
3174
 }
3282
   #endif
3282
   #endif
3283
 
3283
 
3284
   #ifdef WATCH_TEMP_PERIOD
3284
   #ifdef WATCH_TEMP_PERIOD
3285
-    start_watching_heaters();
3285
+    start_watching_heater(target_extruder);
3286
   #endif
3286
   #endif
3287
 
3287
 
3288
   millis_t temp_ms = millis();
3288
   millis_t temp_ms = millis();

+ 8
- 10
Marlin/temperature.cpp View File

1005
    * their target temperature by a configurable margin.
1005
    * their target temperature by a configurable margin.
1006
    * This is called when the temperature is set. (M104, M109)
1006
    * This is called when the temperature is set. (M104, M109)
1007
    */
1007
    */
1008
-  void start_watching_heaters() {
1009
-      millis_t ms = millis() + WATCH_TEMP_PERIOD;
1010
-      for (int e = 0; e < EXTRUDERS; e++) {
1011
-        if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
1012
-          watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1013
-          watch_heater_next_ms[e] = ms;
1014
-        }
1015
-        else
1016
-          watch_heater_next_ms[e] = 0;
1017
-      }
1008
+  void start_watching_heater(int e) {
1009
+    millis_t ms = millis() + WATCH_TEMP_PERIOD;
1010
+    if (degHotend(e) < degTargetHotend(e) - (WATCH_TEMP_INCREASE * 2)) {
1011
+      watch_target_temp[e] = degHotend(e) + WATCH_TEMP_INCREASE;
1012
+      watch_heater_next_ms[e] = ms;
1013
+    }
1014
+    else
1015
+      watch_heater_next_ms[e] = 0;
1018
   }
1016
   }
1019
 #endif
1017
 #endif
1020
 
1018
 

+ 1
- 1
Marlin/temperature.h View File

138
 void checkExtruderAutoFans();
138
 void checkExtruderAutoFans();
139
 
139
 
140
 #ifdef WATCH_TEMP_PERIOD
140
 #ifdef WATCH_TEMP_PERIOD
141
-  void start_watching_heaters();
141
+  void start_watching_heater(int e=0);
142
 #endif
142
 #endif
143
 
143
 
144
 FORCE_INLINE void autotempShutdown() {
144
 FORCE_INLINE void autotempShutdown() {

+ 1
- 1
Marlin/ultralcd.cpp View File

522
   fanSpeed = fan;
522
   fanSpeed = fan;
523
   lcd_return_to_status();
523
   lcd_return_to_status();
524
   #ifdef WATCH_TEMP_PERIOD
524
   #ifdef WATCH_TEMP_PERIOD
525
-    start_watching_heaters();
525
+    if (endnum >= 0) start_watching_heater(endnum);
526
   #endif
526
   #endif
527
 }
527
 }
528
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }
528
 void lcd_preheat_pla0() { _lcd_preheat(0, plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed); }

Loading…
Cancel
Save