From ff45f9d2c437fadba3f94dc069384f341994082b Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sat, 17 Nov 2007 10:29:33 +0000 Subject: [PATCH] Added watchdog support --- platform/sky/contiki-sky-main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/sky/contiki-sky-main.c b/platform/sky/contiki-sky-main.c index d60c8a0ea..e4595222a 100644 --- a/platform/sky/contiki-sky-main.c +++ b/platform/sky/contiki-sky-main.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)$Id: contiki-sky-main.c,v 1.14 2007/11/10 20:44:30 adamdunkels Exp $ + * @(#)$Id: contiki-sky-main.c,v 1.15 2007/11/17 10:29:33 adamdunkels Exp $ */ #include @@ -44,7 +44,7 @@ #include "dev/light.h" #include "dev/xmem.h" #include "dev/simple-cc2420.h" - +#include "dev/watchdog.h" #include "dev/slip.h" #include "dev/uart1.h" @@ -127,7 +127,7 @@ main(int argc, char **argv) #endif /* WITH_UIP */ printf("Starting %s " - "($Id: contiki-sky-main.c,v 1.14 2007/11/10 20:44:30 adamdunkels Exp $)\n", __FILE__); + "($Id: contiki-sky-main.c,v 1.15 2007/11/17 10:29:33 adamdunkels Exp $)\n", __FILE__); leds_on(LEDS_GREEN); ds2411_init(); sensors_light_init(); @@ -197,6 +197,7 @@ main(int argc, char **argv) */ printf("process_run()...\n"); ENERGEST_ON(ENERGEST_TYPE_CPU); + watchdog_start(); while (1) { int r; #if PROFILE_CONF_ON @@ -204,6 +205,7 @@ main(int argc, char **argv) #endif /* PROFILE_CONF_ON */ do { /* Reset watchdog. */ + watchdog_periodic(); r = process_run(); } while(r > 0); #if PROFILE_CONF_ON @@ -225,7 +227,7 @@ main(int argc, char **argv) are asleep, so we discard the processing time done when we were awake. */ energest_type_set(ENERGEST_TYPE_IRQ, irq_energest); - + watchdog_stop(); _BIS_SR(GIE | SCG0 | /*SCG1 |*/ CPUOFF); /* LPM3 sleep. This statement will block until the CPU is @@ -239,6 +241,7 @@ main(int argc, char **argv) dint(); irq_energest = energest_type_time(ENERGEST_TYPE_IRQ); eint(); + watchdog_start(); ENERGEST_OFF(ENERGEST_TYPE_LPM); ENERGEST_ON(ENERGEST_TYPE_CPU); #if PROFILE_CONF_ON