[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc1000 ByteRadio.nc, 1.1.2.6, 1.1.2.7 CC1000ActiveMessageC.nc, 1.1.2.7, 1.1.2.8 CC1000Const.h, 1.1.2.7, 1.1.2.8 CC1000Control.nc, 1.1.2.5, 1.1.2.6 CC1000ControlP.nc, 1.1.2.5, 1.1.2.6 CC1000CsmaP.nc, 1.1.2.13, 1.1.2.14 CC1000CsmaRadioC.nc, 1.1.2.19, 1.1.2.20 CC1000RssiP.nc, 1.1.2.4, 1.1.2.5 CC1000SendReceiveP.nc, 1.1.2.17, 1.1.2.18 CC1000Squelch.nc, 1.1.2.2, 1.1.2.3 CC1000SquelchP.nc, 1.1.2.2, 1.1.2.3 HplCC1000.nc, 1.1.2.3, 1.1.2.4 HplCC1000Spi.nc, 1.1.2.2, 1.1.2.3

David Gay idgay at users.sourceforge.net
Fri Sep 22 11:54:32 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4341

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	ByteRadio.nc CC1000ActiveMessageC.nc CC1000Const.h 
	CC1000Control.nc CC1000ControlP.nc CC1000CsmaP.nc 
	CC1000CsmaRadioC.nc CC1000RssiP.nc CC1000SendReceiveP.nc 
	CC1000Squelch.nc CC1000SquelchP.nc HplCC1000.nc 
	HplCC1000Spi.nc 
Log Message:
merge head







Index: CC1000CsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/CC1000CsmaP.nc,v
retrieving revision 1.1.2.13
retrieving revision 1.1.2.14
diff -C2 -d -r1.1.2.13 -r1.1.2.14
*** CC1000CsmaP.nc	21 Jun 2006 16:58:03 -0000	1.1.2.13
--- CC1000CsmaP.nc	22 Sep 2006 18:54:30 -0000	1.1.2.14
***************
*** 154,159 ****
  
    void radioOff() {
-     call ByteRadio.off();
      call CC1000Control.off();
    }
  
--- 154,159 ----
  
    void radioOff() {
      call CC1000Control.off();
+     call ByteRadio.off();
    }
  
***************
*** 235,243 ****
        case IDLE_STATE:
  	/* Timer already running means that we have a noise floor
! 	   measurement scheduled. */
  	if (!call WakeupTimer.isRunning())
  	  if (call CC1000Squelch.settled())
  	    {
! 	      if (lplRxPower == 0 || f.txPending)
  		call WakeupTimer.startOneShot(CC1K_SquelchIntervalSlow);
  	      else
--- 235,245 ----
        case IDLE_STATE:
  	/* Timer already running means that we have a noise floor
! 	   measurement scheduled. If we just set a new alarm here, we
! 	   might indefinitely delay noise floor measurements if we're,
! 	   e,g, transmitting frequently. */
  	if (!call WakeupTimer.isRunning())
  	  if (call CC1000Squelch.settled())
  	    {
! 	      if (lplRxPower == 0)
  		call WakeupTimer.startOneShot(CC1K_SquelchIntervalSlow);
  	      else
***************
*** 342,345 ****
--- 344,348 ----
      if (data > call CC1000Squelch.get() - (call CC1000Squelch.get() >> 2))
        {
+ 	post sleepCheck();
  	// don't be too agressive (ignore really quiet thresholds).
  	if (data < call CC1000Squelch.get() + (call CC1000Squelch.get() >> 3))
***************
*** 349,353 ****
  	    post adjustSquelch();
  	  }
- 	post sleepCheck();
        }
      else if (count++ > 5)
--- 352,355 ----

Index: CC1000CsmaRadioC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/CC1000CsmaRadioC.nc,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.20
diff -C2 -d -r1.1.2.19 -r1.1.2.20
*** CC1000CsmaRadioC.nc	27 May 2006 21:18:09 -0000	1.1.2.19
--- CC1000CsmaRadioC.nc	22 Sep 2006 18:54:30 -0000	1.1.2.20
***************
*** 109,112 ****
--- 109,113 ----
  
    Rssi.ActualRssi -> Hpl;
+   Rssi.Resource -> Hpl;
    Control.CC -> Hpl;
    Control.BusyWait -> BusyWaitMicroC;

Index: CC1000RssiP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/CC1000RssiP.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** CC1000RssiP.nc	21 Jun 2006 16:58:03 -0000	1.1.2.4
--- CC1000RssiP.nc	22 Sep 2006 18:54:30 -0000	1.1.2.5
***************
*** 48,52 ****
      async command void cancel();
    }
!   uses interface Read<uint16_t> as ActualRssi;
  }
  implementation
--- 48,55 ----
      async command void cancel();
    }
!   uses {
!     interface Resource;
!     interface ReadNow<uint16_t> as ActualRssi;
!   }
  }
  implementation
***************
*** 66,82 ****
    }
  
!   void startNextOp() {
!     if (nextOp != IDLE)
!       {
! 	currentOp = nextOp;
! 	nextOp = IDLE;
! 	call ActualRssi.read();
!       }
!     else
!       currentOp = IDLE;
!   }
! 
!   task void startOpTask() {
!     atomic startNextOp();
    }
  
--- 69,74 ----
    }
  
!   event void Resource.granted() {
!     call ActualRssi.read();
    }
  
***************
*** 84,106 ****
      if (currentOp == IDLE)
        {
! 	nextOp = reason;
! 	post startOpTask();
        }
!     else // We should only come here with currentOp = CANCELLED
        nextOp = reason;
      return SUCCESS;
    }
  
!   event void ActualRssi.readDone(error_t result, uint16_t data) {
!     atomic
        {
! 	uint8_t op = currentOp;
  
  	/* The code assumes that RSSI measurements are 10-bits 
  	   (legacy effect) */
! 	data >>= 6;
  	startNextOp();
- 
- 	signal Rssi.readDone[op](result, data);
        }
    }
--- 76,108 ----
      if (currentOp == IDLE)
        {
! 	currentOp = reason;
! 	if (call Resource.immediateRequest() == SUCCESS)
! 	  call ActualRssi.read();
! 	else
! 	  call Resource.request();
        }
!     else
        nextOp = reason;
      return SUCCESS;
    }
  
!   void startNextOp() {
!     currentOp = nextOp;
!     if (nextOp != IDLE)
        {
! 	nextOp = IDLE;
! 	call ActualRssi.read();
!       }
!     else
!       call Resource.release();
!   }
  
+   async event void ActualRssi.readDone(error_t result, uint16_t data) {
+     atomic
+       {
  	/* The code assumes that RSSI measurements are 10-bits 
  	   (legacy effect) */
! 	signal Rssi.readDone[currentOp](result, data >> 6);
  	startNextOp();
        }
    }

Index: CC1000SendReceiveP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/CC1000SendReceiveP.nc,v
retrieving revision 1.1.2.17
retrieving revision 1.1.2.18
diff -C2 -d -r1.1.2.17 -r1.1.2.18
*** CC1000SendReceiveP.nc	4 Aug 2006 00:34:18 -0000	1.1.2.17
--- CC1000SendReceiveP.nc	22 Sep 2006 18:54:30 -0000	1.1.2.18
***************
*** 485,496 ****
      uint8_t nextByte;
      cc1000_header_t *rxHeader = getHeader(rxBufPtr);
! 
!     // rxLength is the offset into a message_t at which the packet
!     // data ends: it is NOT equal to the number of bytes received,
!     // as there may be padding in the message_t before the packet.
!     uint8_t rxLength = rxHeader->length + offsetof(message_t, data);
  
      // Reject invalid length packets
!     if (rxLength > TOSH_DATA_LENGTH + offsetof(message_t, data))
        {
  	// The packet's screwed up, so just dump it
--- 485,492 ----
      uint8_t nextByte;
      cc1000_header_t *rxHeader = getHeader(rxBufPtr);
!     uint8_t rxLength = rxHeader->length;
  
      // Reject invalid length packets
!     if (rxLength > TOSH_DATA_LENGTH)
        {
  	// The packet's screwed up, so just dump it
***************
*** 504,507 ****
--- 500,505 ----
      ((uint8_t *)rxBufPtr)[count++] = nextByte;
  
+     // Adjust rxLength to correspond to the corresponding offset in message_t
+     rxLength += offsetof(message_t, data);
      if (count <= rxLength)
        runningCrc = crcByte(runningCrc, nextByte);







More information about the Tinyos-2-commits mailing list