From cd1bcb101d578aebfc18e6ea9ea6a0b9cbf634ce Mon Sep 17 00:00:00 2001 From: Atis Elsts Date: Thu, 26 Jan 2017 13:23:30 +0000 Subject: [PATCH] CC26xx IEEE mode radio: fix reading lqi --- cpu/cc26xx-cc13xx/rf-core/ieee-mode.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c index f76fe2beb..d1e7ab7f9 100644 --- a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c +++ b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c @@ -103,8 +103,9 @@ #define IEEE_MODE_RSSI_THRESHOLD 0xA6 #endif /* IEEE_MODE_CONF_RSSI_THRESHOLD */ /*---------------------------------------------------------------------------*/ -#define STATUS_CRC_OK 0x80 -#define STATUS_CORRELATION 0x7f +#define STATUS_CRC_FAIL 0x80 /* bit 7 */ +#define STATUS_REJECT_FRAME 0x40 /* bit 6 */ +#define STATUS_CORRELATION 0x3f /* bits 0-5 */ /*---------------------------------------------------------------------------*/ /* Data entry status field constants */ #define DATA_ENTRY_STATUS_PENDING 0x00 /* Not in use by the Radio CPU */ @@ -1057,7 +1058,7 @@ read_frame(void *buf, unsigned short buf_len) memcpy(buf, (char *)&rx_read_entry[9], len); last_rssi = (int8_t)rx_read_entry[9 + len + 2]; - last_corr_lqi = (uint8_t)rx_read_entry[9 + len + 2] & STATUS_CORRELATION; + last_corr_lqi = (uint8_t)rx_read_entry[9 + len + 3] & STATUS_CORRELATION; /* get the timestamp */ memcpy(&rat_timestamp, (char *)rx_read_entry + 9 + len + 4, 4);