Explorar el Código

THERMAL_PROTECTION_GRACE_PERIOD is obsolete (#14798)

Robby Candra hace 5 años
padre
commit
5bc2fb022c
Se han modificado 3 ficheros con 8 adiciones y 33 borrados
  1. 0
    5
      Marlin/src/HAL/HAL_LPC1768/HAL.h
  2. 2
    1
      Marlin/src/Marlin.cpp
  3. 6
    27
      Marlin/src/module/temperature.cpp

+ 0
- 5
Marlin/src/HAL/HAL_LPC1768/HAL.h Ver fichero

@@ -146,11 +146,6 @@ using FilteredADC = LPC176x::ADC<ADC_LOWPASS_K_VALUE, ADC_MEDIAN_FILTER_SIZE>;
146 146
 #define HAL_READ_ADC()         FilteredADC::get_result()
147 147
 #define HAL_ADC_READY()        FilteredADC::finished_conversion()
148 148
 
149
-// A grace period to allow ADC readings to stabilize, preventing false alarms
150
-#ifndef THERMAL_PROTECTION_GRACE_PERIOD
151
-  #define THERMAL_PROTECTION_GRACE_PERIOD 1000
152
-#endif
153
-
154 149
 // Parse a G-code word into a pin index
155 150
 int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
156 151
 // P0.6 thru P0.9 are for the onboard SD card

+ 2
- 1
Marlin/src/Marlin.cpp Ver fichero

@@ -1137,6 +1137,8 @@ void loop() {
1137 1137
 
1138 1138
   for (;;) {
1139 1139
 
1140
+    idle(); // Do an idle first so boot is slightly faster
1141
+
1140 1142
     #if ENABLED(SDSUPPORT)
1141 1143
 
1142 1144
       card.checkautostart();
@@ -1168,6 +1170,5 @@ void loop() {
1168 1170
     if (queue.length < BUFSIZE) queue.get_available_commands();
1169 1171
     queue.advance();
1170 1172
     endstops.event_handler();
1171
-    idle();
1172 1173
   }
1173 1174
 }

+ 6
- 27
Marlin/src/module/temperature.cpp Ver fichero

@@ -82,10 +82,6 @@
82 82
   #endif
83 83
 #endif
84 84
 
85
-#ifndef THERMAL_PROTECTION_GRACE_PERIOD
86
-  #define THERMAL_PROTECTION_GRACE_PERIOD 0 // No grace period needed on well-behaved boards
87
-#endif
88
-
89 85
 Temperature thermalManager;
90 86
 
91 87
 /**
@@ -1036,18 +1032,9 @@ void Temperature::manage_heater() {
1036 1032
     millis_t ms = millis();
1037 1033
   #endif
1038 1034
 
1039
-  #if HAS_THERMAL_PROTECTION
1040
-    #if THERMAL_PROTECTION_GRACE_PERIOD > 0
1041
-      static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD;
1042
-      if (ELAPSED(ms, grace_period)) grace_period = 0UL;
1043
-    #else
1044
-      static constexpr millis_t grace_period = 0UL;
1045
-    #endif
1046
-  #endif
1047
-
1048 1035
   HOTEND_LOOP() {
1049 1036
     #if ENABLED(THERMAL_PROTECTION_HOTENDS)
1050
-      if (!grace_period && degHotend(e) > temp_range[e].maxtemp)
1037
+      if (degHotend(e) > temp_range[e].maxtemp)
1051 1038
         _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e));
1052 1039
     #endif
1053 1040
 
@@ -1103,7 +1090,7 @@ void Temperature::manage_heater() {
1103 1090
   #if HAS_HEATED_BED
1104 1091
 
1105 1092
     #if ENABLED(THERMAL_PROTECTION_BED)
1106
-      if (!grace_period && degBed() > BED_MAXTEMP)
1093
+      if (degBed() > BED_MAXTEMP)
1107 1094
         _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_BED));
1108 1095
     #endif
1109 1096
 
@@ -1181,7 +1168,7 @@ void Temperature::manage_heater() {
1181 1168
     #endif
1182 1169
 
1183 1170
     #if ENABLED(THERMAL_PROTECTION_CHAMBER)
1184
-      if (!grace_period && degChamber() > CHAMBER_MAXTEMP)
1171
+      if (degChamber() > CHAMBER_MAXTEMP)
1185 1172
         _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_CHAMBER));
1186 1173
     #endif
1187 1174
 
@@ -2224,14 +2211,6 @@ void Temperature::set_current_temp_raw() {
2224 2211
 
2225 2212
 void Temperature::readings_ready() {
2226 2213
 
2227
-  #if THERMAL_PROTECTION_GRACE_PERIOD > 0
2228
-    const millis_t ms = millis();
2229
-    static millis_t grace_period = ms + THERMAL_PROTECTION_GRACE_PERIOD; // NOTE: millis() == 0 on reset
2230
-    if (ELAPSED(ms, grace_period)) grace_period = 0;
2231
-  #else
2232
-    static constexpr millis_t grace_period = 0;
2233
-  #endif
2234
-
2235 2214
   // Update the raw values if they've been read. Else we could be updating them during reading.
2236 2215
   if (!temp_meas_ready) set_current_temp_raw();
2237 2216
 
@@ -2250,6 +2229,9 @@ void Temperature::readings_ready() {
2250 2229
     temp_chamber.acc = 0;
2251 2230
   #endif
2252 2231
 
2232
+  // Give ADC temperature readings time to settle at boot-up before testing
2233
+  if (grace_period) return;
2234
+
2253 2235
   static constexpr int8_t temp_dir[] = {
2254 2236
     #if ENABLED(HEATER_0_USES_MAX6675)
2255 2237
       0
@@ -2277,9 +2259,6 @@ void Temperature::readings_ready() {
2277 2259
     #endif // HOTENDS > 1
2278 2260
   };
2279 2261
 
2280
-  // Give ADC temperature readings time to settle at boot-up before testing
2281
-  if (grace_period) return;
2282
-
2283 2262
   for (uint8_t e = 0; e < COUNT(temp_dir); e++) {
2284 2263
     const int8_t tdir = temp_dir[e];
2285 2264
     if (tdir) {

Loading…
Cancelar
Guardar