|
@@ -31,6 +31,10 @@
|
31
|
31
|
#if ENABLED(SDSUPPORT)
|
32
|
32
|
#include "Sd2Card.h"
|
33
|
33
|
|
|
34
|
+#if ENABLED(USE_WATCHDOG)
|
|
35
|
+ #include "watchdog.h"
|
|
36
|
+#endif
|
|
37
|
+
|
34
|
38
|
//------------------------------------------------------------------------------
|
35
|
39
|
#if DISABLED(SOFTWARE_SPI)
|
36
|
40
|
// functions for hardware SPI
|
|
@@ -299,6 +303,12 @@ bool Sd2Card::init(uint8_t sckRateID, uint8_t chipSelectPin) {
|
299
|
303
|
uint16_t t0 = (uint16_t)millis();
|
300
|
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
|
312
|
// set pin modes
|
303
|
313
|
pinMode(chipSelectPin_, OUTPUT);
|
304
|
314
|
chipSelectHigh();
|