[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc1000 CC1000CsmaP.nc, 1.1.2.11, 1.1.2.12 CC1000SendReceiveP.nc, 1.1.2.14, 1.1.2.15

David Gay idgay at users.sourceforge.net
Tue Jun 13 10:25:34 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	CC1000CsmaP.nc CC1000SendReceiveP.nc 
Log Message:
switching off from a receive handler was buggy
also, sending while off didn't fail
-> cleanup on/off state transitions


Index: CC1000CsmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/Attic/CC1000CsmaP.nc,v
retrieving revision 1.1.2.11
retrieving revision 1.1.2.12
diff -C2 -d -r1.1.2.11 -r1.1.2.12
*** CC1000CsmaP.nc	3 Feb 2006 19:47:34 -0000	1.1.2.11
--- CC1000CsmaP.nc	13 Jun 2006 17:25:31 -0000	1.1.2.12
***************
*** 438,442 ****
  
    async event void ByteRadio.rxDone() {
!     enterIdleStateSetWakeup();
    }
  
--- 438,443 ----
  
    async event void ByteRadio.rxDone() {
!     if (radioState == RX_STATE)
!       enterIdleStateSetWakeup();
    }
  

Index: CC1000SendReceiveP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc1000/Attic/CC1000SendReceiveP.nc,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -C2 -d -r1.1.2.14 -r1.1.2.15
*** CC1000SendReceiveP.nc	25 Apr 2006 23:46:17 -0000	1.1.2.14
--- CC1000SendReceiveP.nc	13 Jun 2006 17:25:31 -0000	1.1.2.15
***************
*** 76,80 ****
  {
    enum {
!     INACTIVE_STATE,		/* Off */
  
      LISTEN_STATE,		/* Listening for packets */
--- 76,82 ----
  {
    enum {
!     OFF_STATE,
! 
!     INACTIVE_STATE,		/* Not listening, but will accept sends */
  
      LISTEN_STATE,		/* Listening for packets */
***************
*** 145,148 ****
--- 147,154 ----
    /*----------------------------*/
  
+   void enterOffState() {
+     radioState = OFF_STATE;
+   }
+ 
    void enterInactiveState() {
      radioState = INACTIVE_STATE;
***************
*** 228,231 ****
--- 234,238 ----
      atomic 
        {
+ 	enterInactiveState();
  	f.txBusy = FALSE;
  	f.invert = call CC1000Control.getLOStatus();
***************
*** 235,239 ****
  
    command error_t StdControl.stop() {
!     atomic enterInactiveState();
      return SUCCESS;
    }
--- 242,246 ----
  
    command error_t StdControl.stop() {
!     atomic enterOffState();
      return SUCCESS;
    }
***************
*** 245,249 ****
      atomic
        {
! 	if (f.txBusy)
  	  return FAIL;
  	else {
--- 252,256 ----
      atomic
        {
! 	if (f.txBusy || radioState == OFF_STATE)
  	  return FAIL;
  	else {
***************
*** 558,562 ****
  	if (pBuf) 
  	  rxBufPtr = pBuf;
! 	enterListenState();
  	signal ByteRadio.rxDone();
        }
--- 565,570 ----
  	if (pBuf) 
  	  rxBufPtr = pBuf;
! 	if (radioState == RECEIVED_STATE) // receiver might've done something
! 	  enterListenState();
  	signal ByteRadio.rxDone();
        }



More information about the Tinyos-2-commits mailing list