From: maxmul Date: Wed, 12 Sep 2007 12:00:50 +0000 (+0000) Subject: fix spi request for packet rx strength and the reading of only one byte in fifo X-Git-Tag: release_tinyos_2_1_0_0~750 X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=commitdiff_plain;h=37eb2fbdf917d2540ea6b01d29cbf041494eb8e4;p=tinyos-2.x.git fix spi request for packet rx strength and the reading of only one byte in fifo --- 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;