35 #include "dev/watchdog.h"
37 static int counter = 0;
39 #define PRINT_STACK_ON_REBOOT 0
42 #if PRINT_STACK_ON_REBOOT
43 #ifdef CONTIKI_TARGET_SKY
51 while((IFG2 & UTXIFG1) == 0);
58 const char hexconv[] =
"0123456789abcdef";
59 printchar(hexconv[v >> 4]);
60 printchar(hexconv[v & 0x0f]);
73 #ifdef __IAR_SYSTEMS_ICC__
74 #pragma vector=WDT_VECTOR
79 watchdog_interrupt(
void)
81 #ifdef CONTIKI_TARGET_SKY
82 #if PRINT_STACK_ON_REBOOT
88 printstring(
"Watchdog reset");
89 printstring(
"\nStack at $");
90 hexprint(((
int)ptr) >> 8);
91 hexprint(((
int)ptr) & 0xff);
94 for(i = 0; i < 64; ++i) {
97 if((i & 0x0f) == 0x0f) {
128 WDTCTL = WDTPW | WDTCNTCL | WDT_ARST_1000 | WDTTMSEL;
133 watchdog_periodic(
void)
138 WDTCTL = (WDTCTL & 0xff) | WDTPW | WDTCNTCL | WDTTMSEL;
148 WDTCTL = WDTPW | WDTHOLD;
153 watchdog_reboot(
void)