From 4b73b48f60ea9274f4a862551a242022f00908dc Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Wed, 20 Jun 2012 11:23:52 +0100 Subject: [PATCH] Fixed the cc2530 RSSI adjustment --- cpu/cc253x/dev/cc2530-rf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpu/cc253x/dev/cc2530-rf.c b/cpu/cc253x/dev/cc2530-rf.c index f33d3ce37..dff05e2d4 100644 --- a/cpu/cc253x/dev/cc2530-rf.c +++ b/cpu/cc253x/dev/cc2530-rf.c @@ -90,6 +90,8 @@ /* Bit Masks for the last byte in the RX FIFO */ #define CRC_BIT_MASK 0x80 #define LQI_BIT_MASK 0x7F +/* RSSI Offset */ +#define RSSI_OFFSET 73 /* 192 ms, radio off -> on interval */ #define ONOFF_TIME RTIMER_ARCH_SECOND / 3125 @@ -385,7 +387,7 @@ read(void *buf, unsigned short bufsize) PUTSTRING("\n"); /* Read the RSSI and CRC/Corr bytes */ - rssi = ((int8_t) RFD) - 45; + rssi = ((int8_t) RFD) - RSSI_OFFSET; crc_corr = RFD; #if CC2530_RF_CONF_HEXDUMP