[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/cc2420/spi CC2420SpiP.nc, 1.1, 1.2

dmm rincon at users.sourceforge.net
Wed Nov 7 14:22:04 PST 2007


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

Modified Files:
	CC2420SpiP.nc 
Log Message:
Razvan and Jeonggil Ko found a problem with the status byte return value on RAM operations, and fixed it.  "Both of them wants to return the status of the operation and the specs says that this is the byte received from SPI after sending the address. The bug is the read is returning the second one (which is not defined) and the write is returning the values overwritten by the last byte."

Index: CC2420SpiP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/cc2420/spi/CC2420SpiP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CC2420SpiP.nc	4 Jul 2007 00:37:16 -0000	1.1
--- CC2420SpiP.nc	7 Nov 2007 22:22:01 -0000	1.2
***************
*** 34,37 ****
--- 34,39 ----
   * @author David Moss
   * @author Roman Lim
+  * @author Razvan Musaloie-E.
+  * @author Jeonggil Ko
   * @version $Revision$ $Date$
   */
***************
*** 245,250 ****
      addr += offset;
  
!     call SpiByte.write( addr | 0x80 );
!     status = call SpiByte.write( ( ( addr >> 1 ) & 0xc0 ) | 0x20 );
      for ( ; len; len-- ) {
        *data++ = call SpiByte.write( 0 );
--- 247,252 ----
      addr += offset;
  
!     status = call SpiByte.write( addr | 0x80 );
!     call SpiByte.write( ( ( addr >> 1 ) & 0xC0 ) | 0x20 );
      for ( ; len; len-- ) {
        *data++ = call SpiByte.write( 0 );
***************
*** 270,277 ****
      addr += offset;
  
!     call SpiByte.write( addr | 0x80 );
      call SpiByte.write( ( addr >> 1 ) & 0xc0 );
      for ( ; len; len-- ) {
!       status = call SpiByte.write( *data++ );
      }
  
--- 272,279 ----
      addr += offset;
  
!     status = call SpiByte.write( addr | 0x80 );
      call SpiByte.write( ( addr >> 1 ) & 0xc0 );
      for ( ; len; len-- ) {
!       call SpiByte.write( *data++ );
      }
  



More information about the Tinyos-2-commits mailing list