summaryrefslogtreecommitdiff
path: root/firmware/src/os/wdt.c
blob: d8a2145c30d73fe0c81a3c0f9cefe0d26aa105cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* AT91SAM7 Watch Dog Timer code for OpenPCD / OpenPICC
 * (C) 2006 by Harald Welte <hwelte@hmw-consulting.de>
 */

#define WDT_DEBUG
 
void wdt_irq(void)
{
	DEBUGPCRF("================> WATCHDOG EXPIRED !!!!!");
}

void wdt_init(void)
{
#ifdef WDT_DEBUG
	AT91F_WDTSetMode(AT91C_BASE_WDT, (0xfff << 16) |
			 AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
			 AT91C_WDTC_WDFIEN);
#else
	AT91F_WDTSetMode(AT91C_BASE_WDT, (0xfff << 16) |
			 AT91C_WDTC_WDDBGHLT | AT91C_WDTC_WDIDLEHLT |
			 AT91C_WDTC_WDRSTEN);
#endif
}
personal git repositories of Harald Welte. Your mileage may vary