[Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/imote2
FlashM.nc, 1.8, 1.9
Josh
jsherbach at users.sourceforge.net
Fri Sep 2 11:00:33 PDT 2005
Update of /cvsroot/tinyos/tinyos-1.x/beta/platform/imote2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11293
Modified Files:
FlashM.nc
Log Message:
fin
Index: FlashM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/imote2/FlashM.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** FlashM.nc 2 Sep 2005 16:02:01 -0000 1.8
--- FlashM.nc 2 Sep 2005 18:00:31 -0000 1.9
***************
*** 173,190 ****
}
! if(blocklen == 1)
! writeHelper(addr,data,numBytes,0xFF,0xFF);
else{
uint32_t bytesLeft = numBytes;
! writeHelper(addr,data, blockAddr + FLASH_BLOCK_SIZE - addr,0xFF,0xFF);
bytesLeft = numBytes - (FLASH_BLOCK_SIZE - (addr - blockAddr));
for(i = 1; i < blocklen - 1; i++){
! writeHelper(blockAddr + i * FLASH_BLOCK_SIZE,
! (uint8_t *)(data + numBytes - bytesLeft),
! FLASH_BLOCK_SIZE,0xFF,0xFF);
bytesLeft -= FLASH_BLOCK_SIZE;
}
! writeHelper(blockAddr + i * FLASH_BLOCK_SIZE,
! data + (numBytes - bytesLeft), bytesLeft, 0xFF,0xFF);
}
}
--- 173,201 ----
}
! if(blocklen == 1){
! status = writeHelper(addr,data,numBytes,0xFF,0xFF);
! if(status != 0x80)
! return FAIL;
! }
else{
uint32_t bytesLeft = numBytes;
! status = writeHelper(addr,data, blockAddr + FLASH_BLOCK_SIZE - addr,0xFF,0xFF);
! if(status != 0x80)
! return FAIL;
bytesLeft = numBytes - (FLASH_BLOCK_SIZE - (addr - blockAddr));
for(i = 1; i < blocklen - 1; i++){
! status = writeHelper(blockAddr + i * FLASH_BLOCK_SIZE,
! (uint8_t *)(data + numBytes - bytesLeft),
! FLASH_BLOCK_SIZE,0xFF,0xFF);
!
bytesLeft -= FLASH_BLOCK_SIZE;
+ if(status != 0x80)
+ return FAIL;
}
! status = writeHelper(blockAddr + i * FLASH_BLOCK_SIZE,
! data + (numBytes - bytesLeft), bytesLeft,
! 0xFF,0xFF);
! if(status != 0x80)
! return FAIL;
}
}
More information about the Tinyos-beta-commits
mailing list