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 4 years ago
parent
commit
dc18769010
No account linked to committer's email address

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

370
   #endif
370
   #endif
371
 #endif
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
 // Full Touch Screen needs 'tft/xpt2046'
373
 // Full Touch Screen needs 'tft/xpt2046'
379
 #if EITHER(TOUCH_SCREEN, HAS_TFT_LVGL_UI)
374
 #if EITHER(TOUCH_SCREEN, HAS_TFT_LVGL_UI)
380
   #define HAS_TFT_XPT2046 1
375
   #define HAS_TFT_XPT2046 1

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

420
 
420
 
421
 // private:
421
 // private:
422
 
422
 
423
-#if EARLY_WATCHDOG
424
-  bool Temperature::inited = false;
425
-#endif
426
-
427
 volatile bool Temperature::raw_temps_ready = false;
423
 volatile bool Temperature::raw_temps_ready = false;
428
 
424
 
429
 #if ENABLED(PID_EXTRUSION_SCALING)
425
 #if ENABLED(PID_EXTRUSION_SCALING)
1205
  *  - Update the heated bed PID output value
1201
  *  - Update the heated bed PID output value
1206
  */
1202
  */
1207
 void Temperature::manage_heater() {
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
   #if ENABLED(EMERGENCY_PARSER)
1206
   #if ENABLED(EMERGENCY_PARSER)
1215
     if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
1207
     if (emergency_parser.killed_by_M112) kill(M112_KILL_STR, nullptr, true);
2015
     TERN_(TEMP_SENSOR_1_IS_MAX6675, max6675_1.begin());
2007
     TERN_(TEMP_SENSOR_1_IS_MAX6675, max6675_1.begin());
2016
   #endif
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
   #if MB(RUMBA)
2010
   #if MB(RUMBA)
2025
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
2011
     // Disable RUMBA JTAG in case the thermocouple extension is plugged on top of JTAG connector
2026
     #define _AD(N) (TEMP_SENSOR_##N##_IS_AD595 || TEMP_SENSOR_##N##_IS_AD8495)
2012
     #define _AD(N) (TEMP_SENSOR_##N##_IS_AD595 || TEMP_SENSOR_##N##_IS_AD8495)
2209
   #endif
2195
   #endif
2210
 
2196
 
2211
   // Wait for temperature measurement to settle
2197
   // Wait for temperature measurement to settle
2212
-  delay(250);
2198
+  //delay(250);
2213
 
2199
 
2214
   #if HAS_HOTEND
2200
   #if HAS_HOTEND
2215
 
2201
 

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

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

Loading…
Cancel
Save