From c12af56ad0d9ad88079fd1cf827d5f65f58f7b18 Mon Sep 17 00:00:00 2001 From: nifi Date: Tue, 18 Sep 2007 10:32:00 +0000 Subject: [PATCH] Turn off ENERGEST_TYPE_TRANSMIT if send error --- core/dev/simple-cc2420.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/dev/simple-cc2420.c b/core/dev/simple-cc2420.c index d4bdee65e..3eadcbdd7 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.8 2007/05/25 08:06:15 adamdunkels Exp $ + * @(#)$Id: simple-cc2420.c,v 1.9 2007/09/18 10:32:00 nifi Exp $ */ /* * This code is almost device independent and should be easy to port. @@ -282,6 +282,7 @@ simple_cc2420_send(const u8_t *payload, u16_t payload_len) if(FIFOP_IS_1 && !FIFO_IS_1) { /* RXFIFO overflow, send on retransmit. */ PRINTF("rxfifo overflow!\n"); + ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT); RELEASE_LOCK(); return -4; } @@ -315,6 +316,8 @@ simple_cc2420_send(const u8_t *payload, u16_t payload_len) } PRINTF("simple_cc2420: do_send() transmission never started\n"); + + ENERGEST_OFF(ENERGEST_TYPE_TRANSMIT); RELEASE_LOCK(); return -3; /* Transmission never started! */ }