[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/TOSBoot TOSBootM.nc, 1.1, 1.2

Razvan Musaloiu-E. razvanm at users.sourceforge.net
Fri Jun 1 17:09:18 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/TOSBoot
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19802/tos/lib/TOSBoot

Modified Files:
	TOSBootM.nc 
Log Message:
Add support for MicaZ to Deluge T2.


Index: TOSBootM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/TOSBoot/TOSBootM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** TOSBootM.nc	22 May 2007 20:34:21 -0000	1.1
--- TOSBootM.nc	2 Jun 2007 00:09:15 -0000	1.2
***************
*** 137,146 ****
      curAddr = curAddr + 8;
  
!     // check that the image starts on the correct boundary
      if (intAddr != TOSBOOT_END) {
        call ExtFlash.stopRead();
        return R_INVALID_IMAGE_ERROR;
      }
! 
      while ( secLength ) {
        
--- 137,153 ----
      curAddr = curAddr + 8;
  
! #if defined(PLATFORM_TELOSB)
      if (intAddr != TOSBOOT_END) {
+ #elif defined(PLATFORM_MICAZ)
+     if (intAddr != 0) {
+ #else
+   #error "Target platform is not currently supported by Deluge T2"
+ #endif
        call ExtFlash.stopRead();
        return R_INVALID_IMAGE_ERROR;
      }
!     
!     call ExtFlash.stopRead();   // MIKE_LIANG
!     
      while ( secLength ) {
        
***************
*** 152,157 ****
  
  	// check if secLength is all ones
! 	if ( secLength == 0xffffffff )
  	  return FAIL;
  
  	buf[(uint16_t)intAddr % TOSBOOT_INT_PAGE_SIZE] = call ExtFlash.readByte();
--- 159,166 ----
  
  	// check if secLength is all ones
! 	if ( secLength == 0xffffffff ) {
! 	  call ExtFlash.stopRead();   // MIKE_LIANG
  	  return FAIL;
+ 	}
  
  	buf[(uint16_t)intAddr % TOSBOOT_INT_PAGE_SIZE] = call ExtFlash.readByte();
***************
*** 174,180 ****
        // write out page
        if (call ProgFlash.write(pageAddr*TOSBOOT_INT_PAGE_SIZE, buf,
! 			       TOSBOOT_INT_PAGE_SIZE) == FAIL)
  	return R_PROGRAMMING_ERROR;
! 
      }
  
--- 183,189 ----
        // write out page
        if (call ProgFlash.write(pageAddr*TOSBOOT_INT_PAGE_SIZE, buf,
! 			       TOSBOOT_INT_PAGE_SIZE) == FAIL) {
  	return R_PROGRAMMING_ERROR;
!       }
      }
  
***************
*** 201,205 ****
        runApp();
      }
! 
      // get current value of counter
      call IntFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &args, sizeof(args));
--- 210,214 ----
        runApp();
      }
!     
      // get current value of counter
      call IntFlash.read((uint8_t*)TOSBOOT_ARGS_ADDR, &args, sizeof(args));
***************
*** 214,219 ****
        // if an error happened during reprogramming, reboot and try again
        //   not much else we can do :-/
!       if (programImage(TOSBOOT_GOLDEN_IMG_ADDR) == R_PROGRAMMING_ERROR)
  	call Hardware.reboot();
      }
      else {
--- 223,229 ----
        // if an error happened during reprogramming, reboot and try again
        //   not much else we can do :-/
!       if (programImage(TOSBOOT_GOLDEN_IMG_ADDR) == R_PROGRAMMING_ERROR) {
  	call Hardware.reboot();
+       }
      }
      else {



More information about the Tinyos-2-commits mailing list