summaryrefslogtreecommitdiff
path: root/firmware/src/os/wdt.c
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-30 22:37:48 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-30 22:37:48 +0000
commit48afc6a1d1a9166508304cc01b2cfc1899d2b163 (patch)
treef6bda86d05d99ead8625c2dbf7d03e43b1991b48 /firmware/src/os/wdt.c
parent0a3534e799f84dee188cec2085553d6203aa7689 (diff)
- add (currently inactive) code for the watch dog timer
git-svn-id: https://svn.openpcd.org:2342/trunk@240 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/os/wdt.c')
-rw-r--r--firmware/src/os/wdt.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/firmware/src/os/wdt.c b/firmware/src/os/wdt.c
index 579d15d..5a3c809 100644
--- a/firmware/src/os/wdt.c
+++ b/firmware/src/os/wdt.c
@@ -17,21 +17,31 @@
*
*/
+#include <lib_AT91SAM7.h>
+#include <AT91SAM7.h>
+
+#include <os/dbgu.h>
+
#define WDT_DEBUG
-void wdt_irq(void)
+static void wdt_irq(void)
{
DEBUGPCRF("================> WATCHDOG EXPIRED !!!!!");
}
+void wdt_restart(void)
+{
+ AT91F_WDTRestart(AT91C_BASE_WDTC);
+}
+
void wdt_init(void)
{
#ifdef WDT_DEBUG
- AT91F_WDTSetMode(AT91C_BASE_WDT, (0xfff << 16) |
+ AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xfff << 16) |
AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
AT91C_WDTC_WDFIEN);
#else
- AT91F_WDTSetMode(AT91C_BASE_WDT, (0xfff << 16) |
+ AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xfff << 16) |
AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
AT91C_WDTC_WDRSTEN);
#endif
personal git repositories of Harald Welte. Your mileage may vary