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

steve ayer ayer1 at users.sourceforge.net
Mon Jun 16 10:00:50 PDT 2008


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/lib/SD
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv4681

Modified Files:
	SD_DMA_M.nc 
Log Message:

atomic designation on code block in spiSendByte removed, as this was
causing timer interrupts to be delayed/blocked. 

comment incorrectly referring to USART1 was fixed.



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.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SD_DMA_M.nc	27 Mar 2008 19:10:26 -0000	1.1
--- SD_DMA_M.nc	16 Jun 2008 17:00:47 -0000	1.2
***************
*** 108,112 ****
  	SPI should be set to less than 400 kHz at start.
  
! 	USART1 is connected to SD card, the USB control chip, etc.
  
  	\tinyos-1.x\tos\platform\msp430\HPLUSART1M.nc has the code
--- 108,112 ----
  	SPI should be set to less than 400 kHz at start.
  
! 	USART0 is connected to SD card, the USB control chip, etc.
  
  	\tinyos-1.x\tos\platform\msp430\HPLUSART1M.nc has the code
***************
*** 175,178 ****
--- 175,183 ----
   
  Added SD_DMA_dockingEvent interface to notify platform when it is docked and undocked.
+ -------------------------------------------------------------------------------
+ 06-02-08
+ Timer interrupts were not generated while waiting for SD card write. Removed the atomic statement
+ from the spiSendByte () function. There are two while statements in the function that can take 
+ an indeterminate time to complete.
  
   */
***************
*** 402,406 ****
  	/////////////////////////////////////////////////////////////////////////
  	async event void DockInterrupt.fired() {
! 
  		if (call DockInterrupt.getValue() == TRUE){      // off the dock
  			call SD.forceInit();
--- 407,411 ----
  	/////////////////////////////////////////////////////////////////////////
  	async event void DockInterrupt.fired() {
!  
  		if (call DockInterrupt.getValue() == TRUE){      // off the dock
  			call SD.forceInit();
***************
*** 468,478 ****
  	// SD card always responds with a byte for everybyte sent?
  	/////////////////////////////////////////////////////////////////////////
    	uint8_t spiSendByte (const uint8_t data) {
!     	atomic{
!   
! 			while(call USARTControl.isTxEmpty() == FAIL);   
! 			call USARTControl.tx(data);
! 			while(call USARTControl.isRxIntrPending() == FAIL);    		}
!     	return call USARTControl.rx();
    	}
      
--- 473,486 ----
  	// SD card always responds with a byte for everybyte sent?
  	/////////////////////////////////////////////////////////////////////////
+ 	// REVISED: 6-02-08 SPL
+ 	// removed atomic statement
+ 	/////////////////////////////////////////////////////////////////////////
    	uint8_t spiSendByte (const uint8_t data) {
!    
! 		while(call USARTControl.isTxEmpty() == FAIL);   
! 		call USARTControl.tx(data);
! 		while(call USARTControl.isRxIntrPending() == FAIL);    		 
! //    	return call USARTControl.rx();			// this disables interrupts
! 		return U0RXBUF;
    	}
      
***************
*** 987,990 ****
--- 995,999 ----
  		// Ignore the checksum  
  		SD_delay(4);
+ 		TOSH_TOGGLE_SER0_CTS_PIN ();
  
  		// Check for the busy flag (set on a write block) 
***************
*** 999,1002 ****
--- 1008,1012 ----
  			}
  		}
+ 		TOSH_TOGGLE_SER0_CTS_PIN ();
   
   		CS_HIGH ();



More information about the Tinyos-contrib-commits mailing list