1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/cc2538: use RX FIFO count to determine CRC OK location

This commit is contained in:
Thijs Havinga 2024-11-06 14:41:37 +01:00 committed by GitHub
parent 06aaf648e3
commit 81358aa7b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -412,9 +412,9 @@ void cc2538_irq_handler(void)
if (flags_f0 & RXPKTDONE) {
handled_f0 |= RXPKTDONE;
/* CRC check */
uint8_t pkt_len = rfcore_peek_rx_fifo(0);
if (rfcore_peek_rx_fifo(pkt_len) & CC2538_CRC_BIT_MASK) {
/* CRC_OK bit is in the last byte in the RX FIFO */
uint8_t crc_loc = RFCORE_XREG_RXFIFOCNT - 1;
if (rfcore_peek_rx_fifo(crc_loc) & CC2538_CRC_BIT_MASK) {
/* Disable RX while the frame has not been processed */
_disable_rx();
/* If AUTOACK is disabled or the ACK request bit is not set */