From b0291ca5a8d7df17db569005bc598b0d7b962656 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Tue, 6 Oct 2009 09:21:46 +0000 Subject: [PATCH] bug fix: wake up MSP430 when leaving rtimer interrupt if the rtimer polled a process. thanks to Marco Vedovati for finding the bug --- cpu/msp430/rtimer-arch.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cpu/msp430/rtimer-arch.c b/cpu/msp430/rtimer-arch.c index 87b6db15d..774c27692 100644 --- a/cpu/msp430/rtimer-arch.c +++ b/cpu/msp430/rtimer-arch.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: rtimer-arch.c,v 1.8 2008/12/02 12:44:48 joxe Exp $ + * $Id: rtimer-arch.c,v 1.9 2009/10/06 09:21:46 fros4943 Exp $ */ /** @@ -43,6 +43,7 @@ #include "sys/energest.h" #include "sys/rtimer.h" +#include "sys/process.h" #define DEBUG 0 #if DEBUG @@ -56,6 +57,9 @@ interrupt(TIMERA0_VECTOR) timera0 (void) { ENERGEST_ON(ENERGEST_TYPE_IRQ); rtimer_run_next(); + if(process_nevents() > 0) { + LPM4_EXIT; + } ENERGEST_OFF(ENERGEST_TYPE_IRQ); } /*---------------------------------------------------------------------------*/