34#include "dev/watchdog.h"
35#include "isr_compat.h"
37static 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]);
73ISR(WDT, watchdog_interrupt)
75#ifdef CONTIKI_TARGET_SKY
76#if PRINT_STACK_ON_REBOOT
82 printstring(
"Watchdog reset");
83 printstring(
"\nStack at $");
84 hexprint(((
int)ptr) >> 8);
85 hexprint(((
int)ptr) & 0xff);
88 for(i = 0; i < 64; ++i) {
91 if((i & 0x0f) == 0x0f) {
109#if CONTIKI_TARGET_WISMOTE
125 WDTCTL = WDTPW | WDTCNTCL | WDT_ARST_1000 | WDTTMSEL;
135 WDTCTL = (WDTCTL & 0xff) | WDTPW | WDTCNTCL | WDTTMSEL;
144 WDTCTL = WDTPW | WDTHOLD;
void watchdog_reboot(void)
Keeps control until the WDT throws a reset signal.
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
void watchdog_periodic(void)
Writes the WDT clear sequence.
void watchdog_init(void)
Initialisation function for the WDT.
void watchdog_stop(void)
Stops the WDT such that it won't timeout and cause MCU reset.