瀏覽代碼

Option to assist thermocouple debug (#18621)

Axel 4 年之前
父節點
當前提交
c4dd0082a1
No account linked to committer's email address
共有 1 個文件被更改,包括 15 次插入14 次删除
  1. 15
    14
      Marlin/src/module/temperature.cpp

+ 15
- 14
Marlin/src/module/temperature.cpp 查看文件

@@ -24,6 +24,9 @@
24 24
  * temperature.cpp - temperature control
25 25
  */
26 26
 
27
+// Useful when debugging thermocouples
28
+//#define IGNORE_THERMOCOUPLE_ERRORS
29
+
27 30
 #include "temperature.h"
28 31
 #include "endstops.h"
29 32
 
@@ -1011,14 +1014,15 @@ void Temperature::manage_heater() {
1011 1014
 
1012 1015
   updateTemperaturesFromRawValues(); // also resets the watchdog
1013 1016
 
1014
-  #if ENABLED(HEATER_0_USES_MAX6675)
1015
-    if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0);
1016
-    if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0);
1017
-  #endif
1018
-
1019
-  #if ENABLED(HEATER_1_USES_MAX6675)
1020
-    if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1);
1021
-    if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1);
1017
+  #if DISABLED(IGNORE_THERMOCOUPLE_ERRORS)
1018
+    #if ENABLED(HEATER_0_USES_MAX6675)
1019
+      if (temp_hotend[0].celsius > _MIN(HEATER_0_MAXTEMP, HEATER_0_MAX6675_TMAX - 1.0)) max_temp_error(H_E0);
1020
+      if (temp_hotend[0].celsius < _MAX(HEATER_0_MINTEMP, HEATER_0_MAX6675_TMIN + .01)) min_temp_error(H_E0);
1021
+    #endif
1022
+    #if ENABLED(HEATER_1_USES_MAX6675)
1023
+      if (temp_hotend[1].celsius > _MIN(HEATER_1_MAXTEMP, HEATER_1_MAX6675_TMAX - 1.0)) max_temp_error(H_E1);
1024
+      if (temp_hotend[1].celsius < _MAX(HEATER_1_MINTEMP, HEATER_1_MAX6675_TMIN + .01)) min_temp_error(H_E1);
1025
+    #endif
1022 1026
   #endif
1023 1027
 
1024 1028
   millis_t ms = millis();
@@ -2180,7 +2184,7 @@ void Temperature::disable_all_heaters() {
2180 2184
 
2181 2185
     WRITE_MAX6675(HIGH); // disable TT_MAX6675
2182 2186
 
2183
-    if (max6675_temp & MAX6675_ERROR_MASK) {
2187
+    if (DISABLED(IGNORE_THERMOCOUPLE_ERRORS) && (max6675_temp & MAX6675_ERROR_MASK)) {
2184 2188
       max6675_errors[hindex] += 1;
2185 2189
       if (max6675_errors[hindex] > THERMOCOUPLE_MAX_ERRORS) {
2186 2190
         SERIAL_ERROR_START();
@@ -2201,16 +2205,13 @@ void Temperature::disable_all_heaters() {
2201 2205
         max6675_temp = 4 * (
2202 2206
           #if COUNT_6675 > 1
2203 2207
             hindex ? HEATER_1_MAX6675_TMAX : HEATER_0_MAX6675_TMAX
2204
-          #elif ENABLED(HEATER_1_USES_MAX6675)
2205
-            HEATER_1_MAX6675_TMAX
2206 2208
           #else
2207
-            HEATER_0_MAX6675_TMAX
2209
+            TERN(HEATER_1_USES_MAX6675, HEATER_1_MAX6675_TMAX, HEATER_0_MAX6675_TMAX)
2208 2210
           #endif
2209 2211
         );
2210 2212
       }
2211
-      else {
2213
+      else
2212 2214
         max6675_temp >>= MAX6675_DISCARD_BITS;
2213
-      }
2214 2215
     }
2215 2216
     else {
2216 2217
       max6675_temp >>= MAX6675_DISCARD_BITS;

Loading…
取消
儲存