From 0859d4b95f313a240cd14a10f04b21ad69e620d7 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Fri, 30 Apr 2010 07:32:39 +0000 Subject: [PATCH] Avoid turning off the radio in the middle of a packet reception --- core/net/mac/xmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/net/mac/xmac.c b/core/net/mac/xmac.c index 22e6d6a77..2f1c40508 100644 --- a/core/net/mac/xmac.c +++ b/core/net/mac/xmac.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: xmac.c,v 1.55 2010/03/01 13:30:23 nifi Exp $ + * $Id: xmac.c,v 1.56 2010/04/30 07:32:39 adamdunkels Exp $ */ /** @@ -61,7 +61,7 @@ #include #ifndef WITH_ACK_OPTIMIZATION -#define WITH_ACK_OPTIMIZATION 1 +#define WITH_ACK_OPTIMIZATION 0 #endif #ifndef WITH_ENCOUNTER_OPTIMIZATION #define WITH_ENCOUNTER_OPTIMIZATION 1 @@ -298,7 +298,7 @@ powercycle(struct rtimer *t, void *ptr) schedule_powercycle(t, xmac_config.on_time); PT_YIELD(&pt); - if(xmac_config.off_time > 0) { + if(xmac_config.off_time > 0 && !NETSTACK_RADIO.receiving_packet()) { powercycle_turn_radio_off(); if(waiting_for_packet != 0) { waiting_for_packet++;