Bläddra i källkod

THERMAL_PROTECTION_GRACE_PERIOD is obsolete (#14798)

Robby Candra 5 år sedan
förälder
incheckning
5bc2fb022c
3 ändrade filer med 8 tillägg och 33 borttagningar
  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 Visa fil

146
 #define HAL_READ_ADC()         FilteredADC::get_result()
146
 #define HAL_READ_ADC()         FilteredADC::get_result()
147
 #define HAL_ADC_READY()        FilteredADC::finished_conversion()
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
 // Parse a G-code word into a pin index
149
 // Parse a G-code word into a pin index
155
 int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
150
 int16_t PARSED_PIN_INDEX(const char code, const int16_t dval);
156
 // P0.6 thru P0.9 are for the onboard SD card
151
 // P0.6 thru P0.9 are for the onboard SD card

+ 2
- 1
Marlin/src/Marlin.cpp Visa fil

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

+ 6
- 27
Marlin/src/module/temperature.cpp Visa fil

82
   #endif
82
   #endif
83
 #endif
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
 Temperature thermalManager;
85
 Temperature thermalManager;
90
 
86
 
91
 /**
87
 /**
1036
     millis_t ms = millis();
1032
     millis_t ms = millis();
1037
   #endif
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
   HOTEND_LOOP() {
1035
   HOTEND_LOOP() {
1049
     #if ENABLED(THERMAL_PROTECTION_HOTENDS)
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
         _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e));
1038
         _temp_error((heater_ind_t)e, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, e));
1052
     #endif
1039
     #endif
1053
 
1040
 
1103
   #if HAS_HEATED_BED
1090
   #if HAS_HEATED_BED
1104
 
1091
 
1105
     #if ENABLED(THERMAL_PROTECTION_BED)
1092
     #if ENABLED(THERMAL_PROTECTION_BED)
1106
-      if (!grace_period && degBed() > BED_MAXTEMP)
1093
+      if (degBed() > BED_MAXTEMP)
1107
         _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_BED));
1094
         _temp_error(H_BED, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_BED));
1108
     #endif
1095
     #endif
1109
 
1096
 
1181
     #endif
1168
     #endif
1182
 
1169
 
1183
     #if ENABLED(THERMAL_PROTECTION_CHAMBER)
1170
     #if ENABLED(THERMAL_PROTECTION_CHAMBER)
1184
-      if (!grace_period && degChamber() > CHAMBER_MAXTEMP)
1171
+      if (degChamber() > CHAMBER_MAXTEMP)
1185
         _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_CHAMBER));
1172
         _temp_error(H_CHAMBER, PSTR(MSG_T_THERMAL_RUNAWAY), TEMP_ERR_PSTR(MSG_THERMAL_RUNAWAY, H_CHAMBER));
1186
     #endif
1173
     #endif
1187
 
1174
 
2224
 
2211
 
2225
 void Temperature::readings_ready() {
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
   // Update the raw values if they've been read. Else we could be updating them during reading.
2214
   // Update the raw values if they've been read. Else we could be updating them during reading.
2236
   if (!temp_meas_ready) set_current_temp_raw();
2215
   if (!temp_meas_ready) set_current_temp_raw();
2237
 
2216
 
2250
     temp_chamber.acc = 0;
2229
     temp_chamber.acc = 0;
2251
   #endif
2230
   #endif
2252
 
2231
 
2232
+  // Give ADC temperature readings time to settle at boot-up before testing
2233
+  if (grace_period) return;
2234
+
2253
   static constexpr int8_t temp_dir[] = {
2235
   static constexpr int8_t temp_dir[] = {
2254
     #if ENABLED(HEATER_0_USES_MAX6675)
2236
     #if ENABLED(HEATER_0_USES_MAX6675)
2255
       0
2237
       0
2277
     #endif // HOTENDS > 1
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
   for (uint8_t e = 0; e < COUNT(temp_dir); e++) {
2262
   for (uint8_t e = 0; e < COUNT(temp_dir); e++) {
2284
     const int8_t tdir = temp_dir[e];
2263
     const int8_t tdir = temp_dir[e];
2285
     if (tdir) {
2264
     if (tdir) {

Laddar…
Avbryt
Spara