summaryrefslogtreecommitdiff
path: root/firmware/bluetooth_rxtx
diff options
context:
space:
mode:
authorHannes Ellinger <hannes.ellinger@eas.iis.fraunhofer.de>2016-03-24 11:30:17 +0100
committerHannes Ellinger <hannes.ellinger@eas.iis.fraunhofer.de>2016-05-12 16:51:33 +0200
commit9e3ecc7e3b48a5d8c94d0a8952c7aa27efa67307 (patch)
tree675ce55e41f0a75f66aafb02274cd0547ba99527 /firmware/bluetooth_rxtx
parent2be24006e980bc6af67e7e91c8b8480166d54a12 (diff)
use -dBm as input parameter for rssi threshold since cc2400 has an rssi range of [-120; -20] dBm
Diffstat (limited to 'firmware/bluetooth_rxtx')
-rw-r--r--firmware/bluetooth_rxtx/bluetooth_rxtx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/bluetooth_rxtx/bluetooth_rxtx.c b/firmware/bluetooth_rxtx/bluetooth_rxtx.c
index cb0e202..32334c5 100644
--- a/firmware/bluetooth_rxtx/bluetooth_rxtx.c
+++ b/firmware/bluetooth_rxtx/bluetooth_rxtx.c
@@ -386,7 +386,7 @@ static int vendor_request_handler(uint8_t request, uint16_t* request_params, uin
case UBERTOOTH_LED_SPECAN:
if (request_params[0] > 256)
return 0;
- rssi_threshold = (int8_t)request_params[0];
+ rssi_threshold = 54 - request_params[0];
requested_mode = MODE_LED_SPECAN;
*data_len = 0;
break;
@@ -2134,7 +2134,7 @@ void led_specan()
/* give the CC2400 time to acquire RSSI reading */
volatile u32 j = 500; while (--j); //FIXME crude delay
- lvl = cc2400_get(RSSI) >> 8;
+ lvl = (int8_t)((cc2400_get(RSSI) >> 8) & 0xff);
if (lvl > rssi_threshold) {
switch (i) {
case 0: