|
|
@ -1,21 +1,10 @@
|
|
|
|
#include "Marlin.h"
|
|
|
|
#include "Marlin.h"
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(USE_WATCHDOG)
|
|
|
|
#if ENABLED(USE_WATCHDOG)
|
|
|
|
#include <avr/wdt.h>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "watchdog.h"
|
|
|
|
#include "watchdog.h"
|
|
|
|
#include "ultralcd.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
// Initialize watchdog with a 4 sec interrupt time
|
|
|
|
//============================ private variables ============================
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
//================================ functions ================================
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// intialise watch dog with a 4 sec interrupt time
|
|
|
|
|
|
|
|
void watchdog_init() {
|
|
|
|
void watchdog_init() {
|
|
|
|
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
|
|
|
#if ENABLED(WATCHDOG_RESET_MANUAL)
|
|
|
|
// We enable the watchdog timer, but only for the interrupt.
|
|
|
|
// We enable the watchdog timer, but only for the interrupt.
|
|
|
@ -28,11 +17,6 @@ void watchdog_init() {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// reset watchdog. MUST be called every 1s after init or avr will reset.
|
|
|
|
|
|
|
|
void watchdog_reset() {
|
|
|
|
|
|
|
|
wdt_reset();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===========================================================================
|
|
|
|
//===========================================================================
|
|
|
|
//=================================== ISR ===================================
|
|
|
|
//=================================== ISR ===================================
|
|
|
|
//===========================================================================
|
|
|
|
//===========================================================================
|
|
|
@ -45,6 +29,6 @@ ISR(WDT_vect) {
|
|
|
|
kill(PSTR("ERR:Please Reset")); //kill blocks //16 characters so it fits on a 16x2 display
|
|
|
|
kill(PSTR("ERR:Please Reset")); //kill blocks //16 characters so it fits on a 16x2 display
|
|
|
|
while (1); //wait for user or serial reset
|
|
|
|
while (1); //wait for user or serial reset
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif//RESET_MANUAL
|
|
|
|
#endif //WATCHDOG_RESET_MANUAL
|
|
|
|
|
|
|
|
|
|
|
|
#endif //USE_WATCHDOG
|
|
|
|
#endif //USE_WATCHDOG
|
|
|
|