]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/at45db/At45dbP.nc
turn on safe compilation for some modules
[tinyos-2.x.git] / tos / chips / at45db / At45dbP.nc
index 90b3d313b1434a89ccaa7129dac5c1ce2ea58e72..1de75c80c01e68a94697060c06ebed2b3a72f3db 100644 (file)
@@ -39,7 +39,7 @@
  * @author David Gay
  */
 
-module At45dbP {
+module At45dbP @safe() {
   provides {
     interface Init;
     interface At45db;
@@ -367,8 +367,9 @@ implementation
                  void * COUNT_NOK(n) reqdata, at45pageoffset_t n) {
     request = req;
 
-    reqBuf = reqdata;
+    reqBuf = NULL;
     reqBytes = n;
+    reqBuf = reqdata;
     reqPage = page;
     reqOffset = offset;
 
@@ -398,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,