From 37eb2fbdf917d2540ea6b01d29cbf041494eb8e4 Mon Sep 17 00:00:00 2001 From: maxmul Date: Wed, 12 Sep 2007 12:00:50 +0000 Subject: [PATCH] fix spi request for packet rx strength and the reading of only one byte in fifo --- tos/chips/xe1205/phy/XE1205PhyP.nc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tos/chips/xe1205/phy/XE1205PhyP.nc b/tos/chips/xe1205/phy/XE1205PhyP.nc index 377ad953..d43dc468 100644 --- a/tos/chips/xe1205/phy/XE1205PhyP.nc +++ b/tos/chips/xe1205/phy/XE1205PhyP.nc @@ -239,7 +239,7 @@ implementation { // so that we know precisely when last byte was received if (n > 16) { - if (n < 32) nextRxLen = n - 16; else nextRxLen = 15; + if (n < 32) nextRxLen = n - 15; else nextRxLen = 15; } else { nextRxLen = n; @@ -282,9 +282,6 @@ implementation { error_t getRssi() { error_t err; - if(call SpiResourceRssi.immediateRequest() != SUCCESS) { - return FAIL; - } err = call XE1205RssiConf.setRssiMode(TRUE); err = ecombine(err,call XE1205RssiConf.setRssiRange(FALSE)); rssiRange=RSSI_RANGE_LOW; @@ -301,6 +298,11 @@ implementation { if (call XE1205PhyRxTx.off()) { return EOFF; } + + if(call SpiResourceRssi.immediateRequest() != SUCCESS) { + return FAIL; + } + err=getRssi(); if (SUCCESS ==err) { state = RADIO_RSSI; -- 2.39.2