From: Bernhard Kubicek Date: Sun, 6 Nov 2011 13:58:12 +0000 (+0100) Subject: wrong file location X-Git-Tag: iwj-success-2012-07-29~257 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=7cc358b56b02a121e90e1c5a80ccc91d328487b0;p=marlin.git wrong file location --- diff --git a/Marlin/watchdog.cpp b/Marlin/watchdog.cpp new file mode 100644 index 0000000..0adf9cc --- /dev/null +++ b/Marlin/watchdog.cpp @@ -0,0 +1,48 @@ +#ifdef USE_WATCHDOG + +#include +#include + +volatile uint8_t timeout_seconds=0; + +void(* ctrlaltdelete) (void) = 0; //does not work on my atmega2560 + +//Watchdog timer interrupt, called if main program blocks >1sec +ISR(WDT_vect) +{ + if(timeout_seconds++ >= WATCHDOG_TIMEOUT) + { + + #ifdef RESET_MANUAL + LCD_MESSAGE("Please Reset!"); + ECHOLN("echo_: Something is wrong, please turn off the printer."); + #else + LCD_MESSAGE("Timeout, resetting!"); + #endif + //disable watchdog, it will survife reboot. + WDTCSR |= (1<