]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/lib/tosboot/TOSBootM.nc
Fix for Deluge T2 to properly deal with images bigger than 64K.
[tinyos-2.x.git] / tos / lib / tosboot / TOSBootM.nc
index e04718f4d33d0abb97845aaf126aa3857511e20b..fb73723ee06b280c220ece55e8579befcf59c60c 100644 (file)
@@ -96,10 +96,11 @@ implementation {
   }
 
   bool verifyImage(ex_flash_addr_t startAddr) {
-    uint16_t addr;
+    uint32_t addr;
     uint8_t  numPgs;
     uint8_t  i;
 
+
     if (!verifyBlock(startAddr + offsetof(DelugeIdent,crc),
                     startAddr, offsetof(DelugeIdent,crc)))
       return FALSE;
@@ -118,9 +119,6 @@ implementation {
     for ( i = 0; i < numPgs; i++ ) {
       if (!verifyBlock(startAddr + i*sizeof(uint16_t),
                       startAddr + addr, DELUGE_BYTES_PER_PAGE)) {
-       if (i == 0)
-         while (1)
-           call Leds.flash(2);
        return FALSE;
       }
       addr += DELUGE_BYTES_PER_PAGE;
@@ -131,7 +129,7 @@ implementation {
 
   error_t programImage(ex_flash_addr_t startAddr) {
     uint8_t  buf[TOSBOOT_INT_PAGE_SIZE];
-    uint16_t pageAddr, newPageAddr;
+    uint32_t pageAddr, newPageAddr;
     in_flash_addr_t intAddr;
     in_flash_addr_t secLength;
     ex_flash_addr_t curAddr;