]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
fix spi request for packet rx strength and the reading of only one byte in fifo
authormaxmul <maxmul>
Wed, 12 Sep 2007 12:00:50 +0000 (12:00 +0000)
committermaxmul <maxmul>
Wed, 12 Sep 2007 12:00:50 +0000 (12:00 +0000)
tos/chips/xe1205/phy/XE1205PhyP.nc

index 377ad953ea75bcbd57de65b10428968b6143a9a5..d43dc4685a7ec63f63d4aa8267dcf342cf89d99f 100644 (file)
@@ -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;