waiting for valid RSSI bugfix, minor cleanup
This commit is contained in:
parent
dd8469ee4a
commit
127503e2a6
1 changed files with 8 additions and 14 deletions
|
@ -28,7 +28,7 @@
|
||||||
*
|
*
|
||||||
* This file is part of the Contiki operating system.
|
* This file is part of the Contiki operating system.
|
||||||
*
|
*
|
||||||
* @(#)$Id: simple-cc2420.c,v 1.12 2007/10/25 09:38:15 adamdunkels Exp $
|
* @(#)$Id: simple-cc2420.c,v 1.13 2007/10/25 13:29:21 adamdunkels Exp $
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* This code is almost device independent and should be easy to port.
|
* This code is almost device independent and should be easy to port.
|
||||||
|
@ -255,14 +255,11 @@ simple_cc2420_send(const u8_t *payload, u16_t payload_len)
|
||||||
/* Wait for previous transmission to finish and RSSI. */
|
/* Wait for previous transmission to finish and RSSI. */
|
||||||
do {
|
do {
|
||||||
spiStatusByte = status();
|
spiStatusByte = status();
|
||||||
if(!(spiStatusByte & BV(CC2420_RSSI_VALID))) { /* RSSI needed by CCA */
|
} while(spiStatusByte & BV(CC2420_TX_ACTIVE) &&
|
||||||
continue;
|
!(spiStatusByte & BV(CC2420_RSSI_VALID)));
|
||||||
}
|
|
||||||
} while(spiStatusByte & BV(CC2420_TX_ACTIVE));
|
|
||||||
|
|
||||||
/* Write packet to TX FIFO, appending FCS if AUTOCRC is enabled. */
|
|
||||||
strobe(CC2420_SFLUSHTX); /* Cancel send that never started. */
|
|
||||||
|
|
||||||
|
/* Write packet to TX FIFO. */
|
||||||
|
strobe(CC2420_SFLUSHTX);
|
||||||
|
|
||||||
{
|
{
|
||||||
u8_t total_len = /*2 +*/ payload_len + 2; /* 2 bytes time stamp,
|
u8_t total_len = /*2 +*/ payload_len + 2; /* 2 bytes time stamp,
|
||||||
|
@ -477,9 +474,6 @@ simple_cc2420_read(u8_t *buf, u16_t bufsize)
|
||||||
if(footer[1] & FOOTER1_CRC_OK) {
|
if(footer[1] & FOOTER1_CRC_OK) {
|
||||||
simple_cc2420_last_rssi = footer[0];
|
simple_cc2420_last_rssi = footer[0];
|
||||||
simple_cc2420_last_correlation = footer[1] & FOOTER1_CORRELATION;
|
simple_cc2420_last_correlation = footer[1] & FOOTER1_CORRELATION;
|
||||||
/* if((h.fc0 & FC0_TYPE_MASK) == FC0_TYPE_DATA) {
|
|
||||||
uip_len = len - 2;
|
|
||||||
}*/
|
|
||||||
RIMESTATS_ADD(llrx);
|
RIMESTATS_ADD(llrx);
|
||||||
} else {
|
} else {
|
||||||
RIMESTATS_ADD(badcrc);
|
RIMESTATS_ADD(badcrc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue