[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/transmit CC2420TransmitP.nc, 1.10, 1.11

kusy kusy at users.sourceforge.net
Thu Feb 5 22:38:51 PST 2009


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/transmit
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv311/transmit

Modified Files:
	CC2420TransmitP.nc 
Log Message:
committing new timestamping code

Index: CC2420TransmitP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/transmit/CC2420TransmitP.nc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** CC2420TransmitP.nc	7 Aug 2008 00:06:53 -0000	1.10
--- CC2420TransmitP.nc	6 Feb 2009 06:38:49 -0000	1.11
***************
*** 237,246 ****
    
    
!   inline uint32_t time16to32(uint16_t time, uint32_t recent_time)
    {
!     if ((recent_time&0xFFFF)<time)
!       return ((recent_time-0x10000UL)&0xFFFF0000UL)|time;
!     else
!       return (recent_time&0xFFFF0000UL)|time;
    }
  
--- 237,244 ----
    
    
!   inline uint32_t getTime32(uint16_t time)
    {
!     uint32_t recent_time=call BackoffTimer.getNow();
!     return recent_time + (int16_t)(time - recent_time);
    }
  
***************
*** 259,264 ****
     */
    async event void CaptureSFD.captured( uint16_t time ) {
!     uint32_t time32 = time16to32(time, call BackoffTimer.getNow());
      atomic {
        switch( m_state ) {
          
--- 257,263 ----
     */
    async event void CaptureSFD.captured( uint16_t time ) {
!     uint32_t time32;
      atomic {
+       time32 = getTime32(time);
        switch( m_state ) {
          
***************
*** 285,298 ****
          call BackoffTimer.stop();
  
-         
-         if ( ( ( (call CC2420PacketBody.getHeader( m_msg ))->fcf >> IEEE154_FCF_FRAME_TYPE ) & 7 ) == IEEE154_TYPE_DATA ) {
-           call PacketTimeStamp.set(m_msg, time32);
-         }
-         
          if ( call SFD.get() ) {
            break;
          }
          /** Fall Through because the next interrupt was already received */
!         
        case S_EFD:
          sfdHigh = FALSE;
--- 284,292 ----
          call BackoffTimer.stop();
  
          if ( call SFD.get() ) {
            break;
          }
          /** Fall Through because the next interrupt was already received */
! 
        case S_EFD:
          sfdHigh = FALSE;
***************
*** 312,316 ****
          
        default:
!         if ( !m_receiving ) {
            sfdHigh = TRUE;
            call CaptureSFD.captureFallingEdge();
--- 306,310 ----
          
        default:
!         if ( !m_receiving && sfdHigh == FALSE ) {
            sfdHigh = TRUE;
            call CaptureSFD.captureFallingEdge();
***************
*** 324,337 ****
          }
          
!         sfdHigh = FALSE;
!         call CaptureSFD.captureRisingEdge();
!         m_receiving = FALSE;
!         if ( time - m_prev_time < 10 ) {
!           call CC2420Receive.sfd_dropped();
! 	  if (m_msg)
! 	    call PacketTimeStamp.clear(m_msg);
          }
-         break;
-       
        }
      }
--- 318,332 ----
          }
          
!         if ( sfdHigh == TRUE ) {
!           sfdHigh = FALSE;
!           call CaptureSFD.captureRisingEdge();
!           m_receiving = FALSE;
!           if ( time - m_prev_time < 10 ) {
!             call CC2420Receive.sfd_dropped();
!             if (m_msg)
!               call PacketTimeStamp.clear(m_msg);
!           }
!           break;
          }
        }
      }



More information about the Tinyos-2-commits mailing list