瀏覽代碼

Only watch the heater that was set

Scott Lahteine 10 年之前
父節點
當前提交
9b3d4380d3
共有 4 個文件被更改,包括 12 次插入14 次删除
  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 查看文件

@@ -3168,7 +3168,7 @@ inline void gcode_M104() {
3168 3168
     #endif
3169 3169
 
3170 3170
     #ifdef WATCH_TEMP_PERIOD
3171
-      start_watching_heaters();
3171
+      start_watching_heater(target_extruder);
3172 3172
     #endif
3173 3173
   }
3174 3174
 }
@@ -3282,7 +3282,7 @@ inline void gcode_M109() {
3282 3282
   #endif
3283 3283
 
3284 3284
   #ifdef WATCH_TEMP_PERIOD
3285
-    start_watching_heaters();
3285
+    start_watching_heater(target_extruder);
3286 3286
   #endif
3287 3287
 
3288 3288
   millis_t temp_ms = millis();

+ 8
- 10
Marlin/temperature.cpp 查看文件

@@ -1005,16 +1005,14 @@ void tp_init() {
1005 1005
    * their target temperature by a configurable margin.
1006 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 1017
 #endif
1020 1018
 

+ 1
- 1
Marlin/temperature.h 查看文件

@@ -138,7 +138,7 @@ void setExtruderAutoFanState(int pin, bool state);
138 138
 void checkExtruderAutoFans();
139 139
 
140 140
 #ifdef WATCH_TEMP_PERIOD
141
-  void start_watching_heaters();
141
+  void start_watching_heater(int e=0);
142 142
 #endif
143 143
 
144 144
 FORCE_INLINE void autotempShutdown() {

+ 1
- 1
Marlin/ultralcd.cpp 查看文件

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

Loading…
取消
儲存