diff options
| author | Keith Packard <keithp@keithp.com> | 2012-06-27 17:17:44 -0700 |
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2012-06-27 17:17:44 -0700 |
| commit | 84f9a525c64491afa9b7a565e3c10a4cee106e14 (patch) | |
| tree | 33f5fc926fbe26f9f90f7475d1bb1d590d9edf07 /src/drivers | |
| parent | b0b7f5da2d29716959c6793d744e47a3d435c247 (diff) | |
altos: Clean up radio CRC handling
Make the FEC code just set the CRC_OK bit like the cc1111 radio does;
eliminates a bunch of weird conventions across the FEC API.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/ao_cc1120.c | 7 | ||||
| -rw-r--r-- | src/drivers/ao_packet.c | 4 |
2 files changed, 2 insertions, 9 deletions
diff --git a/src/drivers/ao_cc1120.c b/src/drivers/ao_cc1120.c index c974613e..30663042 100644 --- a/src/drivers/ao_cc1120.c +++ b/src/drivers/ao_cc1120.c @@ -690,12 +690,7 @@ ao_radio_recv(__xdata void *d, uint8_t size) ao_radio_put(); - /* Construct final packet */ - - if (ret && ((uint8_t *) d)[size] == 0 && ((uint8_t *)d)[size+1] == 0) - ((uint8_t *) d)[size + 1] = 0x80; - else - ((uint8_t *) d)[size + 1] = 0x00; + /* Store the received RSSI value; the crc-OK byte is already done */ ((uint8_t *) d)[size] = (uint8_t) rssi; diff --git a/src/drivers/ao_packet.c b/src/drivers/ao_packet.c index 19fe0558..28a0c415 100644 --- a/src/drivers/ao_packet.c +++ b/src/drivers/ao_packet.c @@ -65,10 +65,8 @@ ao_packet_recv(void) /* Check to see if we got a valid packet */ if (!dma_done) return 0; -#ifdef PKT_APPEND_STATUS_1_CRC_OK - if (!(ao_rx_packet.status & PKT_APPEND_STATUS_1_CRC_OK)) + if (!(ao_rx_packet.status & AO_RADIO_STATUS_CRC_OK)) return 0; -#endif /* Accept packets with matching call signs, or any packet if * our callsign hasn't been configured |
