35 #include "dev/watchdog.h"
36 #include "isr_compat.h"
38 static int counter = 0;
40 #define PRINT_STACK_ON_REBOOT 0
43 #if PRINT_STACK_ON_REBOOT
44 #ifdef CONTIKI_TARGET_SKY
52 while((IFG2 & UTXIFG1) == 0);
59 const char hexconv[] =
"0123456789abcdef";
60 printchar(hexconv[v >> 4]);
61 printchar(hexconv[v & 0x0f]);
74 ISR(WDT, watchdog_interrupt)
76 #ifdef CONTIKI_TARGET_SKY
77 #if PRINT_STACK_ON_REBOOT
83 printstring(
"Watchdog reset");
84 printstring(
"\nStack at $");
85 hexprint(((
int)ptr) >> 8);
86 hexprint(((
int)ptr) & 0xff);
89 for(i = 0; i < 64; ++i) {
92 if((i & 0x0f) == 0x0f) {
110 #if CONTIKI_TARGET_WISMOTE
126 WDTCTL = WDTPW | WDTCNTCL | WDT_ARST_1000 | WDTTMSEL;
136 WDTCTL = (WDTCTL & 0xff) | WDTPW | WDTCNTCL | WDTTMSEL;
145 WDTCTL = WDTPW | WDTHOLD;
void watchdog_stop(void)
Stops the WDT such that it won't timeout and cause MCU reset.
void watchdog_reboot(void)
Keeps control until the WDT throws a reset signal.
void watchdog_periodic(void)
Writes the WDT clear sequence.
void watchdog_init(void)
Initialisation function for the WDT.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.