|
@@ -30,16 +30,22 @@
|
30
|
30
|
|
31
|
31
|
#include "../../Marlin.h"
|
32
|
32
|
|
33
|
|
-// Initialize watchdog with a 4 sec interrupt time
|
|
33
|
+// Initialize watchdog with 8s timeout, if possible. Otherwise, make it 4s.
|
34
|
34
|
void watchdog_init() {
|
|
35
|
+ #if ENABLED(WATCHDOG_DURATION_8S) && defined(WDTO_8S)
|
|
36
|
+ #define WDTO_NS WDTO_8S
|
|
37
|
+ #else
|
|
38
|
+ #define WDTO_NS WDTO_4S
|
|
39
|
+ #endif
|
35
|
40
|
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
36
|
41
|
// We enable the watchdog timer, but only for the interrupt.
|
37
|
|
- // Take care, as this requires the correct order of operation, with interrupts disabled. See the datasheet of any AVR chip for details.
|
|
42
|
+ // Take care, as this requires the correct order of operation, with interrupts disabled.
|
|
43
|
+ // See the datasheet of any AVR chip for details.
|
38
|
44
|
wdt_reset();
|
39
|
45
|
_WD_CONTROL_REG = _BV(_WD_CHANGE_BIT) | _BV(WDE);
|
40
|
|
- _WD_CONTROL_REG = _BV(WDIE) | WDTO_4S;
|
|
46
|
+ _WD_CONTROL_REG = _BV(WDIE) | WDTO_NS;
|
41
|
47
|
#else
|
42
|
|
- wdt_enable(WDTO_4S);
|
|
48
|
+ wdt_enable(WDTO_NS);
|
43
|
49
|
#endif
|
44
|
50
|
}
|
45
|
51
|
|