[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/tos/lib/SD SD_DMA_M.nc, 1.3, 1.4

steve ayer ayer1 at users.sourceforge.net
Mon May 4 12:32:51 PDT 2009


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/SD
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv31698

Modified Files:
	SD_DMA_M.nc 
Log Message:

repaired a bug in the writeBlock routine that left the first byte in
the buffer passed to it behind, and wrote garbage to the card in the
last byte.

what:  changed (near line 839) in writeBlock the naked call to
USARTControl.tx to the more prudent spiSendByte, which waits for the
txtranmit buffer to be clear before beginning.

tested, this seems to repair the problem.

also, added SD.init() to stdcontrol.init.  traditionally, that is where a tinyos
module expects initiation to occur.  author had left this as a
separate operation for the application writer to call.

and, removed '///////'-style comments so that proper indentation could
be restored to the file (this confuses indent-region).



Index: SD_DMA_M.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/SD/SD_DMA_M.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SD_DMA_M.nc	19 Aug 2008 18:51:46 -0000	1.3
--- SD_DMA_M.nc	4 May 2009 19:32:49 -0000	1.4
***************
*** 1,54 ****
  /* ***********************************************************
! * THIS PROGRAM IS PROVIDED "AS IS". TI MAKES NO WARRANTIES OR
! * REPRESENTATIONS, EITHER EXPRESS, IMPLIED OR STATUTORY, 
! * INCLUDING ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS 
! * FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR 
! * COMPLETENESS OF RESPONSES, RESULTS AND LACK OF NEGLIGENCE. 
! * TI DISCLAIMS ANY WARRANTY OF TITLE, QUIET ENJOYMENT, QUIET 
! * POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY 
! * INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO THE PROGRAM OR 
! * YOUR USE OF THE PROGRAM.
[...2086 lines suppressed...]
!      * special handling that needs to be done. The card will
!      * output a continuous stream of zeros, so the end of the BUSY
!      * state is signaled by any nonzero response. The bus idles
!      * high.
!      */
!     i = 0;
!     if (responseType == R1B) {
!       /* This should never time out, unless SDI is grounded.
!        * Don't bother forcing a timeout condition here. */
!       do {
! 	i++;
! 	tmp = spiSendByte(0xFF);
!       } while (tmp != 0xFF);
  
!       spiSendByte(0xFF);
!     }
!     CS_HIGH ();
!     return 1;
!   }
  }



More information about the Tinyos-contrib-commits mailing list