[Tinyos-beta-commits]
CVS: tinyos-1.x/beta/STM25P BlockRead.nc, 1.1,
1.2 BlockStorageM.nc, 1.2, 1.3 FlashVolume.nc, 1.1,
1.2 FlashVolumeM.nc, 1.2, 1.3 FlashWPM.nc, 1.1, 1.2 STM25P.h,
1.1, 1.2 STM25P.nc, 1.2, 1.3 STM25PC.nc, 1.1, 1.2 STM25PM.nc,
1.2, 1.3
Jonathan Hui
jwhui at users.sourceforge.net
Fri Nov 26 12:09:51 PST 2004
- Previous message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge Deluge.h,
1.2, 1.3 DelugeC.nc, 1.1, 1.2 DelugeDataRead.nc, 1.1,
1.2 DelugeDataWrite.nc, 1.1, 1.2 DelugeM.nc, 1.2,
1.3 DelugeMetadata.h, 1.1, 1.2 DelugeMetadata.nc, 1.1,
1.2 DelugeMetadataC.nc, 1.1, 1.2 DelugeMetadataM.nc, 1.2,
1.3 DelugeMetadataRead.nc, 1.1, 1.2 DelugeMetadataWrite.nc,
1.1, 1.2 DelugeMsgs.h, 1.1, 1.2 DelugePageTransfer.nc, 1.1,
1.2 DelugePageTransferC.nc, 1.2, 1.3 DelugePageTransferM.nc,
1.2, 1.3 DelugeStorage.nc, 1.1, 1.2 DelugeStorageC.nc, 1.2,
1.3 DelugeStorageM.nc, 1.2, 1.3 NetProg.h, 1.1,
1.2 NetProgC.nc, 1.1, 1.2 NetProgM.nc, 1.1, 1.2
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge
NetProgC.nc, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/tinyos/tinyos-1.x/beta/STM25P
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2566
Modified Files:
BlockRead.nc BlockStorageM.nc FlashVolume.nc FlashVolumeM.nc
FlashWPM.nc STM25P.h STM25P.nc STM25PC.nc STM25PM.nc
Log Message:
- Added a command to calculate crc for an arbitrary, contiguous region.
Index: BlockRead.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/BlockRead.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** BlockRead.nc 20 Nov 2004 18:59:42 -0000 1.1
--- BlockRead.nc 26 Nov 2004 20:09:46 -0000 1.2
***************
*** 34,36 ****
--- 34,39 ----
command result_t verify();
event result_t verifyDone(result_t result);
+
+ command result_t computeCrc(block_addr_t addr, block_addr_t len);
+ event result_t computeCrcDone(result_t result, uint16_t crc);
}
Index: BlockStorageM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/BlockStorageM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** BlockStorageM.nc 22 Nov 2004 05:15:32 -0000 1.2
--- BlockStorageM.nc 26 Nov 2004 20:09:46 -0000 1.3
***************
*** 48,51 ****
--- 48,52 ----
S_READ,
S_VERIFY,
+ S_CRC,
};
***************
*** 58,61 ****
--- 59,63 ----
block_addr_t curAddr;
block_addr_t bytesRemaining;
+ uint16_t crc;
command result_t StdControl.init() {
***************
*** 82,85 ****
--- 84,88 ----
case S_WRITE: return signal BlockWrite.writeDone[client](result);
case S_ERASE: return signal BlockWrite.eraseDone[client](result);
+ case S_CRC: return signal BlockRead.computeCrcDone[client](result, crc);
}
***************
*** 205,208 ****
--- 208,231 ----
}
+ command result_t BlockRead.computeCrc[uint8_t id](block_addr_t addr, block_addr_t len) {
+
+ stm25p_addr_t physicalAddr;
+
+ if (admitRequest(id) == FAIL)
+ return FAIL;
+
+ state = S_CRC;
+
+ physicalAddr = call ActualFV.physicalAddr[client](addr);
+
+ if (call STM25P.computeCrc(physicalAddr, len) == FAIL) {
+ state = S_IDLE;
+ return FAIL;
+ }
+
+ return SUCCESS;
+
+ }
+
event result_t STM25P.readDone(result_t result) {
signalDone(result);
***************
*** 247,250 ****
--- 270,279 ----
}
+ event result_t STM25P.computeCrcDone(result_t result, uint16_t crcResult) {
+ crc = crcResult;
+ signalDone(result);
+ return SUCCESS;
+ }
+
default event result_t BlockWrite.writeDone[uint8_t id](result_t result) { return SUCCESS; }
default event result_t BlockWrite.eraseDone[uint8_t id](result_t result) { return SUCCESS; }
***************
*** 252,255 ****
--- 281,285 ----
default event result_t BlockRead.readDone[uint8_t id](result_t result) { return SUCCESS; }
default event result_t BlockRead.verifyDone[uint8_t id](result_t result) { return SUCCESS; }
+ default event result_t BlockRead.computeCrcDone[uint8_t id](result_t result, uint16_t crcResult) { return SUCCESS; }
}
Index: FlashVolume.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/FlashVolume.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FlashVolume.nc 20 Nov 2004 18:59:43 -0000 1.1
--- FlashVolume.nc 26 Nov 2004 20:09:46 -0000 1.2
***************
*** 27,34 ****
includes FlashVolume;
- includes STM25P;
interface FlashVolume {
command result_t mount(uint8_t uid);
! command stm25p_addr_t physicalAddr(uint32_t volumeAddr);
}
--- 27,34 ----
includes FlashVolume;
interface FlashVolume {
command result_t mount(uint8_t uid);
! command uint32_t physicalAddr(uint32_t volumeAddr);
! command uint8_t physicalAddrToVolume(uint32_t addr);
}
Index: FlashVolumeM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/FlashVolumeM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** FlashVolumeM.nc 22 Nov 2004 05:17:01 -0000 1.2
--- FlashVolumeM.nc 26 Nov 2004 20:09:46 -0000 1.3
***************
*** 58,64 ****
}
! command stm25p_addr_t FlashVolume.physicalAddr[uint8_t id](uint32_t volumeAddr) {
! stm25p_addr_t base = (stm25p_addr_t)volumeMap[id]*FV_VOLUME_SIZE;
if (volumeMap[id] == FV_INVALID_VOLUME
--- 58,64 ----
}
! command uint32_t FlashVolume.physicalAddr[uint8_t id](uint32_t volumeAddr) {
! uint32_t base = (uint32_t)volumeMap[id]*FV_VOLUME_SIZE;
if (volumeMap[id] == FV_INVALID_VOLUME
***************
*** 70,72 ****
--- 70,76 ----
}
+ command uint8_t FlashVolume.physicalAddrToVolume[uint8_t id](uint32_t addr) {
+ return addr / FV_VOLUME_SIZE;
+ }
+
}
Index: FlashWPM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/FlashWPM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FlashWPM.nc 22 Nov 2004 05:14:23 -0000 1.1
--- FlashWPM.nc 26 Nov 2004 20:09:46 -0000 1.2
***************
*** 59,62 ****
--- 59,63 ----
event result_t STM25P.sectorEraseDone(result_t result) { return SUCCESS; }
event result_t STM25P.bulkEraseDone(result_t result) { return SUCCESS; }
+ event result_t STM25P.computeCrcDone(result_t result, uint16_t crc) { return SUCCESS; }
}
Index: STM25P.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/STM25P.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** STM25P.h 20 Nov 2004 18:59:43 -0000 1.1
--- STM25P.h 26 Nov 2004 20:09:46 -0000 1.2
***************
*** 48,51 ****
--- 48,52 ----
#define STM25P_DP 0xb9 // 1, 0, 0, 0, 0
#define STM25P_RES 0xab // 1, 0, 3, 0, 1
+ #define STM25P_CRC 0xff // not really an instruction
typedef uint8_t stm25p_status_t;
Index: STM25P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/STM25P.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** STM25P.nc 22 Nov 2004 05:15:32 -0000 1.2
--- STM25P.nc 26 Nov 2004 20:09:46 -0000 1.3
***************
*** 42,45 ****
--- 42,48 ----
event result_t writeSRDone(result_t result);
+ command result_t computeCrc(stm25p_addr_t addr, stm25p_addr_t len);
+ event result_t computeCrcDone(result_t result, uint16_t crc);
+
command stm25p_sig_t getSignature();
}
Index: STM25PC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/STM25PC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** STM25PC.nc 20 Nov 2004 18:59:43 -0000 1.1
--- STM25PC.nc 26 Nov 2004 20:09:46 -0000 1.2
***************
*** 26,29 ****
--- 26,30 ----
*/
+ includes crc;
includes STM25P;
Index: STM25PM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/STM25P/STM25PM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** STM25PM.nc 22 Nov 2004 05:15:32 -0000 1.2
--- STM25PM.nc 26 Nov 2004 20:09:46 -0000 1.3
***************
*** 45,49 ****
stm25p_sig_t signature;
! uint8_t curCmd;
void sendCmd(uint8_t cmd, stm25p_addr_t addr, uint8_t* data, stm25p_addr_t len);
--- 45,50 ----
stm25p_sig_t signature;
! uint16_t crc;
! uint8_t curCmd;
void sendCmd(uint8_t cmd, stm25p_addr_t addr, uint8_t* data, stm25p_addr_t len);
***************
*** 68,71 ****
--- 69,73 ----
case STM25P_BE: return signal STM25P.bulkEraseDone(result);
case STM25P_WRSR: return signal STM25P.writeSRDone(result);
+ case STM25P_CRC: return signal STM25P.computeCrcDone(result, crc);
}
return SUCCESS;
***************
*** 97,108 ****
uint8_t addrBytes[STM25P_ADDR_SIZE];
! int8_t i;
// start command
! call HPLSTM25P.beginCmd(cmd);
!
// address
switch(cmd) {
! case STM25P_READ: case STM25P_FAST_READ: case STM25P_PP: case STM25P_SE:
for ( i = 0; i < STM25P_ADDR_SIZE; i++ )
addrBytes[i] = (addr >> ((STM25P_ADDR_SIZE-1-i)*8)) & 0xff;
--- 99,114 ----
uint8_t addrBytes[STM25P_ADDR_SIZE];
! stm25p_addr_t i;
// start command
! switch(cmd) {
! case STM25P_CRC: call HPLSTM25P.beginCmd(STM25P_READ); break;
! default: call HPLSTM25P.beginCmd(cmd); break;
! }
!
// address
switch(cmd) {
! case STM25P_READ: case STM25P_FAST_READ: case STM25P_PP:
! case STM25P_SE: case STM25P_CRC:
for ( i = 0; i < STM25P_ADDR_SIZE; i++ )
addrBytes[i] = (addr >> ((STM25P_ADDR_SIZE-1-i)*8)) & 0xff;
***************
*** 129,132 ****
--- 135,145 ----
call HPLSTM25P.txBuf(data, len);
break;
+ case STM25P_CRC:
+ for ( i = 0; i < len; i++ ) {
+ uint8_t byte;
+ call HPLSTM25P.rxBuf(&byte, 1);
+ crc = crcByte(crc, byte);
+ }
+ break;
}
***************
*** 160,163 ****
--- 173,177 ----
curCmd = cmd;
+ crc = 0;
// enable writes if needed
***************
*** 202,205 ****
--- 216,223 ----
}
+ command result_t STM25P.computeCrc(stm25p_addr_t addr, stm25p_addr_t len) {
+ return newRequest(STM25P_CRC, addr, NULL, len);
+ }
+
command stm25p_sig_t STM25P.getSignature() {
return signature;
- Previous message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge Deluge.h,
1.2, 1.3 DelugeC.nc, 1.1, 1.2 DelugeDataRead.nc, 1.1,
1.2 DelugeDataWrite.nc, 1.1, 1.2 DelugeM.nc, 1.2,
1.3 DelugeMetadata.h, 1.1, 1.2 DelugeMetadata.nc, 1.1,
1.2 DelugeMetadataC.nc, 1.1, 1.2 DelugeMetadataM.nc, 1.2,
1.3 DelugeMetadataRead.nc, 1.1, 1.2 DelugeMetadataWrite.nc,
1.1, 1.2 DelugeMsgs.h, 1.1, 1.2 DelugePageTransfer.nc, 1.1,
1.2 DelugePageTransferC.nc, 1.2, 1.3 DelugePageTransferM.nc,
1.2, 1.3 DelugeStorage.nc, 1.1, 1.2 DelugeStorageC.nc, 1.2,
1.3 DelugeStorageM.nc, 1.2, 1.3 NetProg.h, 1.1,
1.2 NetProgC.nc, 1.1, 1.2 NetProgM.nc, 1.1, 1.2
- Next message: [Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge
NetProgC.nc, 1.2, 1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Tinyos-beta-commits
mailing list