From 96d896767327594232f67d61f3b58ff41d683944 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Sun, 25 Mar 2007 17:15:30 +0000 Subject: [PATCH] Should subtract two bytes from the length to account for the two-bytes footer --- core/dev/simple-cc2420.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/dev/simple-cc2420.c b/core/dev/simple-cc2420.c index 0c715cb8f..b427efe44 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.3 2007/03/22 23:55:48 adamdunkels Exp $ + * @(#)$Id: simple-cc2420.c,v 1.4 2007/03/25 17:15:30 adamdunkels Exp $ */ /* * This code is almost device independent and should be easy to port. @@ -416,7 +416,7 @@ simple_cc2420_read(u8_t *buf, u8_t bufsize) FASTSPI_READ_FIFO_GARBAGE(len); rx_fifo_remaining_bytes = 0; /* RX FIFO emptied! */ splx(s); - len = 0; + len = 2; /* We eventually return len - 2 */ } else { s = splhigh(); FASTSPI_READ_FIFO_NO_WAIT(buf, len - 2); @@ -447,6 +447,6 @@ simple_cc2420_read(u8_t *buf, u8_t bufsize) splx(s); } - return len; + return len - 2; /* Remove two bytes for the footer. */ } /*---------------------------------------------------------------------------*/