Collaboration diagram for Watchdogs:
![]() |
Platform independent watchdog support is available for the AVR platform and the AT91R40008 MCU.
Functions | |
u_long | NutWatchDogStart (u_long ms, u_long xmode) |
Start the watch dog timer. | |
void | NutWatchDogRestart (void) |
Restart the watch dog timer. | |
void | NutWatchDogDisable (void) |
Disables the watch dog timer. | |
void | NutWatchDogEnable (void) |
Enables the watch dog timer. |
Start the watch dog timer.
This function can be used by applications to prevent hang-ups.
ms | Watch dog time out in milliseconds. | |
xmode | Hardware specific mode. If 0, the default mode is used. In this mode, the watch dog will reset the CPU if not restarted within the specified time out period. |
#include <dev/watchdog.h> #include <sys/timer.h> NutWatchDogStart(550, 0); for(;;) { NutWatchDogRestart(); NutSleep(500); }
Definition at line 47 of file watchdog.c.
References At91WatchDogStart(), and AvrWatchDogStart().
void NutWatchDogRestart | ( | void | ) |
Restart the watch dog timer.
Definition at line 61 of file watchdog.c.
References At91WatchDogRestart(), and AvrWatchDogRestart().
void NutWatchDogDisable | ( | void | ) |
Disables the watch dog timer.
Applications should call this function to temporarily disable the watch dog timer. To re-enable it, call NutWatchDogEnable().
#include <dev/watchdog.h> NutWatchDogStart(100, 0); //Some code here. NutWatchDogRestart(); //Some code here. NutWatchDogDisable(); //Some lengthy code here, like writing to flash memory. NutWatchDogEnable();
Definition at line 73 of file watchdog.c.
References At91WatchDogDisable(), and AvrWatchDogDisable().
void NutWatchDogEnable | ( | void | ) |
Enables the watch dog timer.
The function can be safely used within nested subroutines. The watch dog will be enabled only, if this function is called the same number of times as NutWatchDogDisable(). If enabled, the watch dog timer will also have been re-started and the full time out value is available before another NutWatchDogRestart() is required.
If the watch has not been started by NutWatchDogStart(), then this function does nothing.
Definition at line 85 of file watchdog.c.
References At91WatchDogEnable(), and AvrWatchDogEnable().