Clean up watchdog impl.

This commit is contained in:
Scott Lahteine
2015-10-13 03:57:36 -07:00
committed by Richard Wackerbarth
parent 8f16563bbd
commit b4af4441c5
4 changed files with 37 additions and 44 deletions

View File

@ -2,16 +2,13 @@
#define WATCHDOG_H
#include "Marlin.h"
#include <avr/wdt.h>
#if ENABLED(USE_WATCHDOG)
// initialize watch dog with a 1 sec interrupt time
void watchdog_init();
// pad the dog/reset watchdog. MUST be called at least every second after the first watchdog_init or AVR will go into emergency procedures..
void watchdog_reset();
#else
//If we do not have a watchdog, then we can have empty functions which are optimized away.
FORCE_INLINE void watchdog_init() {};
FORCE_INLINE void watchdog_reset() {};
#endif
// Initialize watchdog with a 4 second interrupt time
void watchdog_init();
// Reset watchdog. MUST be called at least every 4 seconds after the
// first watchdog_init or AVR will go into emergency procedures.
inline void watchdog_reset() { wdt_reset(); }
#endif