From 81358aa7b3dcfdb7b6054fb161e09fca68ea45d7 Mon Sep 17 00:00:00 2001 From: Thijs Havinga <94684410+HavingaThijs@users.noreply.github.com> Date: Wed, 6 Nov 2024 14:41:37 +0100 Subject: [PATCH] cpu/cc2538: use RX FIFO count to determine CRC OK location --- cpu/cc2538/radio/cc2538_rf_radio_ops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/cc2538/radio/cc2538_rf_radio_ops.c b/cpu/cc2538/radio/cc2538_rf_radio_ops.c index 9640f68bcd..31e80be022 100644 --- a/cpu/cc2538/radio/cc2538_rf_radio_ops.c +++ b/cpu/cc2538/radio/cc2538_rf_radio_ops.c @@ -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 */