From 8bcc838d8a20304fbeb2e45207f9f23347fa43ad Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 6 Dec 2009 17:05:45 +0000 Subject: [PATCH] Bugfix: don't set the 'we are sending' flag until we are actually sending --- core/net/mac/xmac.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/net/mac/xmac.c b/core/net/mac/xmac.c index 5e626b4b8..f23d006b9 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.44 2009/12/06 13:16:59 adamdunkels Exp $ + * $Id: xmac.c,v 1.45 2009/12/06 17:05:45 adamdunkels Exp $ */ /** @@ -511,10 +511,6 @@ send_packet(void) return MAC_TX_ERR; } - /* By setting we_are_sending to one, we ensure that the rtimer - powercycle interrupt do not interfere with us sending the packet. */ - we_are_sending = 1; - #if WITH_STREAMING if(is_streaming == 1 && (rimeaddr_cmp(packetbuf_addr(PACKETBUF_ADDR_RECEIVER), @@ -576,6 +572,10 @@ send_packet(void) } #endif /* WITH_ENCOUNTER_OPTIMIZATION */ + /* By setting we_are_sending to one, we ensure that the rtimer + powercycle interrupt do not interfere with us sending the packet. */ + we_are_sending = 1; + t0 = RTIMER_NOW(); strobes = 0;