ソースを参照

Merge pull request #5681 from thinkyhead/rc_prevent_boot_loop

Reset watchdog in SD init to prevent reboot
Scott Lahteine 8年前
コミット
7a9c1a279b
1個のファイルの変更10行の追加0行の削除
  1. 10
    0
      Marlin/Sd2Card.cpp

+ 10
- 0
Marlin/Sd2Card.cpp ファイルの表示

31
 #if ENABLED(SDSUPPORT)
31
 #if ENABLED(SDSUPPORT)
32
 #include "Sd2Card.h"
32
 #include "Sd2Card.h"
33
 
33
 
34
+#if ENABLED(USE_WATCHDOG)
35
+  #include "watchdog.h"
36
+#endif
37
+
34
 //------------------------------------------------------------------------------
38
 //------------------------------------------------------------------------------
35
 #if DISABLED(SOFTWARE_SPI)
39
 #if DISABLED(SOFTWARE_SPI)
36
   // functions for hardware SPI
40
   // functions for hardware SPI
299
   uint16_t t0 = (uint16_t)millis();
303
   uint16_t t0 = (uint16_t)millis();
300
   uint32_t arg;
304
   uint32_t arg;
301
 
305
 
306
+  // If init takes more than 4s it could trigger
307
+  // watchdog leading to a reboot loop.
308
+  #if ENABLED(USE_WATCHDOG)
309
+    watchdog_reset();
310
+  #endif
311
+
302
   // set pin modes
312
   // set pin modes
303
   pinMode(chipSelectPin_, OUTPUT);
313
   pinMode(chipSelectPin_, OUTPUT);
304
   chipSelectHigh();
314
   chipSelectHigh();

読み込み中…
キャンセル
保存