From 349274cb814e0e0aa5c797038803973f1964f681 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 25 Oct 2007 09:38:15 +0000 Subject: [PATCH] Turn off listen energy accounting when transmitting --- core/dev/simple-cc2420.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/dev/simple-cc2420.c b/core/dev/simple-cc2420.c index 5f8760e2c..3f3c575d8 100644 --- a/core/dev/simple-cc2420.c +++ b/core/dev/simple-cc2420.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: simple-cc2420.c,v 1.11 2007/10/25 09:30:39 adamdunkels Exp $ + * @(#)$Id: simple-cc2420.c,v 1.12 2007/10/25 09:38:15 adamdunkels Exp $ */ /* * This code is almost device independent and should be easy to port. @@ -301,12 +301,14 @@ simple_cc2420_send(const u8_t *payload, u16_t payload_len) for(i = LOOP_20_SYMBOLS; i > 0; i--) { if(SFD_IS_1) { /* PRINTF("simple_cc2420: do_send() transmission has started\n");*/ - + + ENERGEST_OFF(ENERGEST_TYPE_LISTEN); ENERGEST_ON(ENERGEST_TYPE_TRANSMIT); do { spiStatusByte = status(); } while(spiStatusByte & BV(CC2420_TX_ACTIVE)); ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT); + ENERGEST_ON(ENERGEST_TYPE_LISTEN); RELEASE_LOCK(); return 0; /* Transmission has started. */