]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
deputy fixes
authoridgay <idgay>
Mon, 23 Jun 2008 19:57:55 +0000 (19:57 +0000)
committeridgay <idgay>
Mon, 23 Jun 2008 19:57:55 +0000 (19:57 +0000)
tos/chips/at45db/At45dbP.nc
tos/chips/at45db/BlockStorageP.nc
tos/chips/at45db/ConfigStorageP.nc

index 33c5ac5bd8e4811c3d2a42af324d107a4179de3f..43fb955969d5f9c3ff60056d8076f92db53ecceb 100644 (file)
@@ -399,8 +399,7 @@ implementation
                                        at45pageoffset_t n,
                                        uint16_t baseCrc) {
     /* This is a hack (store crc in reqBuf), but it saves 2 bytes of RAM */
-    reqBuf = TCAST(uint8_t * COUNT(baseCrc), baseCrc);
-    newRequest(R_READCRC, page, offset, reqBuf, n);
+    newRequest(R_READCRC, page, offset, TCAST(uint8_t * COUNT(n), baseCrc), n);
   }
 
   command void At45db.write(at45page_t page, at45pageoffset_t offset,
index 063040c0eb857cbd12282aa688780db1576b31fb..3fa6a9c546ca9bdb3d31cb35e75c6d497647e82d 100644 (file)
@@ -236,7 +236,7 @@ implementation
     storage_addr_t remaining = s[client].len - currentOffset, addr;
     at45page_t page;
     at45pageoffset_t pageOffset, count;
-    uint8_t *buf = s[client].buf + currentOffset;
+    uint8_t *buf = s[client].buf;
 
     if (remaining == 0)
       {
@@ -254,10 +254,10 @@ implementation
     switch (s[client].request)
       {
       case R_WRITE:
-       call At45db.write(page, pageOffset, buf, count);
+       call At45db.write(page, pageOffset, buf + currentOffset, count);
        break;
       case R_READ:
-       call At45db.read(page, pageOffset, buf, count);
+       call At45db.read(page, pageOffset, buf + currentOffset, count);
        break;
       case R_CRC:
        call At45db.computeCrc(page, pageOffset, count, crc);
index 86914408df2c79f5c610fe0e257333e26cf1c5be..37370f7fdc3acfd7fa5714be4e916d9f7e57fd5d 100644 (file)
@@ -190,7 +190,7 @@ implementation
     return call BlockRead.read[id](addr + sizeof low[0], buf, len);
   }
 
-  void readReadDone(uint8_t id, storage_addr_t addr, void* buf, storage_len_t len, error_t error) {
+  void readReadDone(uint8_t id, storage_addr_t addr, void* COUNT(len) buf, storage_len_t len, error_t error) {
     signal ConfigStorage.readDone[id](addr - sizeof low[0], buf, len, error);
   }
 
@@ -257,7 +257,7 @@ implementation
     signal BConfig.writeContinue[id](error);
   }
 
-  void writeWriteDone(uint8_t id, storage_addr_t addr, void* buf, storage_len_t len, error_t error) {
+  void writeWriteDone(uint8_t id, storage_addr_t addr, void* COUNT(len) buf, storage_len_t len, error_t error) {
     flip(id); // flip back to current half
     signal ConfigStorage.writeDone[id](addr - sizeof low[0], buf, len, error);
   }