]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/net/Deluge/extra/NetProgM.nc
A small fix for mulle and some cleanup.
[tinyos-2.x.git] / tos / lib / net / Deluge / extra / NetProgM.nc
index 7567ad1ad809ead008d6e76de7d3f186708f90f5..e77ebeedeb4b09780359cfa6b8eb8cc0dbe91055 100644 (file)
@@ -53,7 +53,7 @@ implementation {
   command error_t Init.init()
   {
     BootArgs bootArgs;
-    call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+    call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
     // Update the local node ID
     if (bootArgs.address != 0xFFFF) {
@@ -71,11 +71,11 @@ implementation {
     BootArgs bootArgs;
 
     atomic {
-      call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
       if (bootArgs.address != TOS_NODE_ID) {
        bootArgs.address = TOS_NODE_ID;
-       call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+       call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
       }
       netprog_reboot();
     }
@@ -99,14 +99,14 @@ implementation {
     }
 
     atomic {
-      call IFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.read(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
       
       bootArgs.imageAddr = reprogramImgAddr;
       bootArgs.gestureCount = 0xff;
       bootArgs.noReprogram = FALSE;
       bootArgs.address = TOS_NODE_ID;
 
-      call IFlash.write((uint8_t*)TOSBOOT_ARGS_ADDR, &bootArgs, sizeof(bootArgs));
+      call IFlash.write(TCAST(uint8_t* COUNT(sizeof(bootArgs)),TOSBOOT_ARGS_ADDR), &bootArgs, sizeof(bootArgs));
 
       // reboot
       netprog_reboot();