summaryrefslogtreecommitdiff
path: root/firmware/src/os
diff options
context:
space:
mode:
authormeri <meri@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-04-10 17:46:11 +0000
committermeri <meri@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2007-04-10 17:46:11 +0000
commit98f3bcf710fccafb0cc8a4abc43cfc92636ddb07 (patch)
tree48981c5d64ebfd27757ec12976e96b733130e32f /firmware/src/os
parent5dec22afd1553b294f9965570cb08bcad851faf8 (diff)
added watchdog time support and debouncing on power-cycle
git-svn-id: https://svn.openpcd.org:2342/trunk@297 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
Diffstat (limited to 'firmware/src/os')
-rw-r--r--firmware/src/os/main.c4
-rw-r--r--firmware/src/os/wdt.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/firmware/src/os/main.c b/firmware/src/os/main.c
index 0cc9d99..968f6ad 100644
--- a/firmware/src/os/main.c
+++ b/firmware/src/os/main.c
@@ -78,7 +78,9 @@ int main(void)
/* Call application specific main idle function */
_main_func();
dbgu_rb_flush();
- //wdt_restart();
+
+ /* restart watchdog timer */
+ wdt_restart();
#ifdef CONFIG_IDLE
//cpu_idle();
#endif
diff --git a/firmware/src/os/wdt.c b/firmware/src/os/wdt.c
index 55a0e70..5f2aa50 100644
--- a/firmware/src/os/wdt.c
+++ b/firmware/src/os/wdt.c
@@ -23,7 +23,7 @@
#include <os/dbgu.h>
#include <os/system_irq.h>
-#define WDT_DEBUG
+/*#define WDT_DEBUG*/
static void wdt_irq(u_int32_t sr)
{
@@ -39,12 +39,11 @@ void wdt_init(void)
{
sysirq_register(AT91SAM7_SYSIRQ_WDT, &wdt_irq);
#ifdef WDT_DEBUG
- AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xfff << 16) |
+ AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xff << 16) |
AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
AT91C_WDTC_WDFIEN);
#else
- AT91F_WDTSetMode(AT91C_BASE_WDTC, (0xfff << 16) |
- AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
- AT91C_WDTC_WDRSTEN);
+ AT91F_WDTSetMode(AT91C_BASE_WDTC, (0x80 << 16) |
+ AT91C_WDTC_WDRSTEN | 0x80);
#endif
}
personal git repositories of Harald Welte. Your mileage may vary