From 92862ad2a58a8b5f89d31857a33fb066c4a6501c Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Wed, 29 Apr 2009 11:38:50 +0000 Subject: [PATCH] Increased the number of iterations for ugly-hack-loop that checks if a transmission has started, to accommodate a faster CPU speed on the MSP430 --- core/dev/cc2420.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/dev/cc2420.c b/core/dev/cc2420.c index 2b16213ed..9844d7248 100644 --- a/core/dev/cc2420.c +++ b/core/dev/cc2420.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: cc2420.c,v 1.29 2009/03/12 21:58:20 adamdunkels Exp $ + * @(#)$Id: cc2420.c,v 1.30 2009/04/29 11:38:50 adamdunkels Exp $ */ /* * This code is almost device independent and should be easy to port. @@ -358,7 +358,7 @@ cc2420_send(const void *payload, unsigned short payload_len) * transmission starts. */ #ifdef TMOTE_SKY -#define LOOP_20_SYMBOLS 100 /* 326us (msp430 @ 2.4576MHz) */ +#define LOOP_20_SYMBOLS 400 /* 326us (msp430 @ 2.4576MHz) */ #elif __AVR__ #define LOOP_20_SYMBOLS 500 /* XXX */ #endif @@ -637,6 +637,11 @@ cc2420_read(void *buf, unsigned short bufsize) getrxdata(footer, FOOTER_LEN); #if CC2420_CONF_CHECKSUM + if(checksum != crc16_data(buf, len - AUX_LEN, 0)) { + PRINTF("checksum failed 0x%04x != 0x%04x\n", + checksum, crc16_data(buf, len - AUX_LEN, 0)); + } + if(footer[1] & FOOTER1_CRC_OK && checksum == crc16_data(buf, len - AUX_LEN, 0)) { #else