]> 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 10619baf9dbfab32e99547e6c0da861c2c71ab34..1de75c80c01e68a94697060c06ebed2b3a72f3db 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 
-/*                                                                     tab:4
+/*
  * "Copyright (c) 2000-2003 The Regents of the University  of California.  
  * All rights reserved.
  *
@@ -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,