From af21afa7505d67cbda133423e65ad69797c1d33a Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Fri, 10 Dec 2010 13:36:06 +0000 Subject: [PATCH] Make sure that the cycle timing is exact --- core/net/mac/contikimac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/net/mac/contikimac.c b/core/net/mac/contikimac.c index 910981ca7..d9cbf25f5 100644 --- a/core/net/mac/contikimac.c +++ b/core/net/mac/contikimac.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: contikimac.c,v 1.43 2010/12/07 23:12:54 adamdunkels Exp $ + * $Id: contikimac.c,v 1.44 2010/12/10 13:36:06 adamdunkels Exp $ */ /** @@ -315,12 +315,14 @@ powercycle(struct rtimer *t, void *ptr) { PT_BEGIN(&pt); + cycle_start = RTIMER_NOW(); + while(1) { static uint8_t packet_seen; static rtimer_clock_t t0; static uint8_t count; - cycle_start = RTIMER_NOW(); + cycle_start += CYCLE_TIME; if(WITH_STREAMING && is_streaming) { #if NURTIMER