Browse Source

Prevent watchdog reset in setup() (#21776)

Cause `manage_heaters` to only reset the watchdog and return until `setup()` is completed.

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Victor Oliveira 3 years ago
parent
commit
dc18769010
No account linked to committer's email address

+ 0
- 5
Marlin/src/inc/Conditionals_adv.h View File

@@ -370,11 +370,6 @@
370 370
   #endif
371 371
 #endif
372 372
 
373
-// If platform requires early initialization of watchdog to properly boot
374
-#if ENABLED(USE_WATCHDOG) && defined(ARDUINO_ARCH_SAM)
375
-  #define EARLY_WATCHDOG 1
376
-#endif
377
-
378 373
 // Full Touch Screen needs 'tft/xpt2046'
379 374
 #if EITHER(TOUCH_SCREEN, HAS_TFT_LVGL_UI)
380 375
   #define HAS_TFT_XPT2046 1

+ 2
- 16
Marlin/src/module/temperature.cpp View File

@@ -420,10 +420,6 @@ const char str_t_thermal_runaway[] PROGMEM = STR_T_THERMAL_RUNAWAY,
420 420
 
421 421
 // private:
422 422
 
423
-#if EARLY_WATCHDOG
424
-  bool Temperature::inited = false;
425
-#endif
426
-
427 423
 volatile bool Temperature::raw_temps_ready = false;
428 424
 
429 425
 #if ENABLED(PID_EXTRUSION_SCALING)
@@ -1205,11 +1201,7 @@ void Temperature::min_temp_error(const heater_id_t heater_id) {
1205 1201
  *  - Update the heated bed PID output value
1206 1202
  */
1207 1203
 void Temperature::manage_heater() {
1208
-
1209
-  #if EARLY_WATCHDOG
1210
-    // If thermal manager is still not running, make sure to at least reset the watchdog!
1211
-    if (!inited) return watchdog_refresh();
1212
-  #endif
1204
+  if (marlin_state == MF_INITIALIZING) return watchdog_refresh(); // If Marlin isn't started, at least reset the watchdog!
1213 1205
 
1214 1206
   #if ENABLED(EMERGENCY_PARSER)
1215 1207
     if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
@@ -2015,12 +2007,6 @@ void Temperature::init() {
2015 2007
     TERN_(TEMP_SENSOR_1_IS_MAX6675, max6675_1.begin());
2016 2008
   #endif
2017 2009
 
2018
-  #if EARLY_WATCHDOG
2019
-    // Flag that the thermalManager should be running
2020
-    if (inited) return;
2021
-    inited = true;
2022
-  #endif
2023
-
2024 2010
   #if MB(RUMBA)
2025 2011
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
2026 2012
     #define _AD(N) (TEMP_SENSOR_##N##_IS_AD595 || TEMP_SENSOR_##N##_IS_AD8495)
@@ -2209,7 +2195,7 @@ void Temperature::init() {
2209 2195
   #endif
2210 2196
 
2211 2197
   // Wait for temperature measurement to settle
2212
-  delay(250);
2198
+  //delay(250);
2213 2199
 
2214 2200
   #if HAS_HOTEND
2215 2201
 

+ 0
- 4
Marlin/src/module/temperature.h View File

@@ -419,10 +419,6 @@ class Temperature {
419 419
 
420 420
   private:
421 421
 
422
-    #if ENABLED(EARLY_WATCHDOG)
423
-      static bool inited;   // If temperature controller is running
424
-    #endif
425
-
426 422
     static volatile bool raw_temps_ready;
427 423
 
428 424
     #if ENABLED(WATCH_HOTENDS)

Loading…
Cancel
Save