[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420 CC2420SpiImplP.nc, 1.1.2.11, 1.1.2.12

Jonathan Hui jwhui at users.sourceforge.net
Thu Sep 28 12:26:24 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	CC2420SpiImplP.nc 
Log Message:

Changes to SpiByte interface. Return received byte since error_t is no
longer returned.



Index: CC2420SpiImplP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/CC2420SpiImplP.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
*** CC2420SpiImplP.nc	15 Aug 2006 11:59:08 -0000	1.1.2.11
--- CC2420SpiImplP.nc	28 Sep 2006 19:26:21 -0000	1.1.2.12
***************
*** 135,139 ****
      m_addr = addr | 0x40;
      
!     call SpiByte.write( m_addr, &status );
      call Fifo.continueRead[ addr ]( data, len );
      
--- 135,139 ----
      m_addr = addr | 0x40;
      
!     status = call SpiByte.write( m_addr );
      call Fifo.continueRead[ addr ]( data, len );
      
***************
*** 155,159 ****
      m_addr = addr;
  
!     call SpiByte.write( m_addr, &status );
      call SpiPacket.send( data, NULL, len );
  
--- 155,159 ----
      m_addr = addr;
  
!     status = call SpiByte.write( m_addr );
      call SpiPacket.send( data, NULL, len );
  
***************
*** 170,177 ****
      addr += offset;
  
!     call SpiByte.write( addr | 0x80, &status );
!     call SpiByte.write( ( ( addr >> 1 ) & 0xc0 ) | 0x20, &status );
      for ( ; len; len-- )
!       call SpiByte.write( 0, data++ );
  
      return status;
--- 170,177 ----
      addr += offset;
  
!     call SpiByte.write( addr | 0x80 );
!     status = call SpiByte.write( ( ( addr >> 1 ) & 0xc0 ) | 0x20 );
      for ( ; len; len-- )
!       *data++ = call SpiByte.write( 0 );
  
      return status;
***************
*** 191,202 ****
  							    uint8_t len ) {
  
!     cc2420_status_t status;
  
      addr += offset;
  
!     call SpiByte.write( addr | 0x80, &status );
!     call SpiByte.write( ( addr >> 1 ) & 0xc0, &status );
      for ( ; len; len-- )
!       call SpiByte.write( *data++, &status );
  
      return status;
--- 191,202 ----
  							    uint8_t len ) {
  
!     cc2420_status_t status = 0;
  
      addr += offset;
  
!     call SpiByte.write( addr | 0x80 );
!     call SpiByte.write( ( addr >> 1 ) & 0xc0 );
      for ( ; len; len-- )
!       status = call SpiByte.write( *data++ );
  
      return status;
***************
*** 207,218 ****
  
      cc2420_status_t status;
!     uint8_t tmp;
! 
!     call SpiByte.write( addr | 0x40, &status );
!     call SpiByte.write( 0, &tmp );
!     *data = (uint16_t)tmp << 8;
!     call SpiByte.write( 0, &tmp );
!     *data |= tmp;
! 
      return status;
  
--- 207,215 ----
  
      cc2420_status_t status;
!     
!     status = call SpiByte.write( addr | 0x40 );
!     *data = (uint16_t)call SpiByte.write( 0 ) << 8;
!     *data |= call SpiByte.write( 0 );
!     
      return status;
  
***************
*** 221,242 ****
    async command cc2420_status_t Reg.write[ uint8_t addr ]( uint16_t data ) {
  
!     cc2420_status_t status;
! 
!     call SpiByte.write( addr, &status );
!     call SpiByte.write( data >> 8, &status );
!     call SpiByte.write( data & 0xff, &status );
! 
!     return status;
  
    }
  
    async command cc2420_status_t Strobe.strobe[ uint8_t addr ]() {
! 
!     cc2420_status_t status;
! 
!     call SpiByte.write( addr, &status );
! 
!     return status;
! 
    }
  
--- 218,229 ----
    async command cc2420_status_t Reg.write[ uint8_t addr ]( uint16_t data ) {
  
!     call SpiByte.write( addr );
!     call SpiByte.write( data >> 8 );
!     return call SpiByte.write( data & 0xff );
  
    }
  
    async command cc2420_status_t Strobe.strobe[ uint8_t addr ]() {
!     return call SpiByte.write( addr );
    }
  



More information about the Tinyos-2-commits mailing list