[Tinyos-beta-commits] CVS: tinyos-1.x/beta/STM25P BlockStorageM.nc, 1.3, 1.4 HPLSTM25P.nc, 1.1, 1.2 STM25PM.nc, 1.3, 1.4

Jonathan Hui jwhui at users.sourceforge.net
Tue Jan 11 17:35:10 PST 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/STM25P
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26551

Modified Files:
	BlockStorageM.nc HPLSTM25P.nc STM25PM.nc 
Log Message:
- More efficient crc calculation by providing a method in the HPL.



Index: BlockStorageM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/BlockStorageM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** BlockStorageM.nc	26 Nov 2004 20:09:46 -0000	1.3
--- BlockStorageM.nc	12 Jan 2005 01:35:06 -0000	1.4
***************
*** 112,121 ****
  
      block_addr_t pageOffset = curAddr % (block_addr_t)STM25P_PAGE_SIZE;
!     block_addr_t numBytes;
!     
!     if (bytesRemaining < STM25P_PAGE_SIZE - pageOffset)
        numBytes = bytesRemaining;
-     else
-       numBytes = STM25P_PAGE_SIZE - pageOffset;
  
      return numBytes;
--- 112,119 ----
  
      block_addr_t pageOffset = curAddr % (block_addr_t)STM25P_PAGE_SIZE;
!     block_addr_t numBytes = STM25P_PAGE_SIZE - pageOffset;
! 
!     if (bytesRemaining < numBytes)
        numBytes = bytesRemaining;
  
      return numBytes;

Index: HPLSTM25P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/HPLSTM25P.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** HPLSTM25P.nc	20 Nov 2004 18:59:43 -0000	1.1
--- HPLSTM25P.nc	12 Jan 2005 01:35:06 -0000	1.2
***************
*** 35,37 ****
--- 35,38 ----
    async command result_t txBuf(uint8_t* buf, stm25p_addr_t len);
    async command result_t rxBuf(uint8_t* buf, stm25p_addr_t len);
+   async command result_t computeCrc(uint16_t* crcResult, stm25p_addr_t len);
  }

Index: STM25PM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/STM25PM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** STM25PM.nc	26 Nov 2004 20:09:46 -0000	1.3
--- STM25PM.nc	12 Jan 2005 01:35:06 -0000	1.4
***************
*** 77,80 ****
--- 77,85 ----
    task void signalFail() { signalDone(FAIL); }
  
+   void checkPost(bool result) {
+     if (result == FALSE)
+       signalDone(FAIL);
+   }
+ 
    bool isWriting() {
      uint8_t status;
***************
*** 90,97 ****
    task void checkWriteDone() {
      if (isWriting()) {
!       post checkWriteDone();
        return;
      }
      signalDone(SUCCESS);
    }
  
--- 95,103 ----
    task void checkWriteDone() {
      if (isWriting()) {
!       checkPost(post checkWriteDone());
        return;
      }
      signalDone(SUCCESS);
+     return;
    }
  
***************
*** 136,144 ****
        break;
      case STM25P_CRC:
!       for ( i = 0; i < len; i++ ) {
! 	uint8_t byte;
! 	call HPLSTM25P.rxBuf(&byte, 1);
! 	crc = crcByte(crc, byte);
!       }
        break;
      }
--- 142,146 ----
        break;
      case STM25P_CRC:
!       call HPLSTM25P.computeCrc(&crc, len);
        break;
      }
***************
*** 188,194 ****
      if (curCmd == STM25P_WRSR || curCmd == STM25P_PP 
  	|| curCmd == STM25P_SE || curCmd == STM25P_BE)
!       post checkWriteDone();
      else
!       post signalSuccess();
  
      return SUCCESS;
--- 190,196 ----
      if (curCmd == STM25P_WRSR || curCmd == STM25P_PP 
  	|| curCmd == STM25P_SE || curCmd == STM25P_BE)
!       checkPost(post checkWriteDone());
      else
!       checkPost(post signalSuccess());
  
      return SUCCESS;



More information about the Tinyos-beta-commits mailing list