[Tinyos-beta-commits] CVS: tinyos-1.x/beta/Deluge/Deluge/TOSBoot TOSBootM.nc, 1.8, 1.9

Jonathan Hui jwhui at users.sourceforge.net
Thu Jun 16 10:22:33 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6418

Modified Files:
	TOSBootM.nc 
Log Message:
Added notion of status codes that are displayed before
countdown. Status codes are integers flashed three times on the
LEDs. The current codes are:

1 - Battery is low, no programming will happen, even with Golden
    Gesture.
7 - Golden gesture detected and will reprogram to Golden Image.



Index: TOSBootM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/Deluge/Deluge/TOSBoot/TOSBootM.nc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** TOSBootM.nc	9 Jun 2005 19:29:00 -0000	1.8
--- TOSBootM.nc	16 Jun 2005 17:22:31 -0000	1.9
***************
*** 42,45 ****
--- 42,50 ----
  
    enum {
+     LEDS_LOWBATT = 1,
+     LEDS_GESTURE = 7,
+   };
+ 
+   enum {
      R_SUCCESS,
      R_INVALID_IMAGE_ERROR,
***************
*** 54,58 ****
  
      call Leds.set(0x7);
!     for (i = 0; i < 3; i++, output >>= 1 ) {
        for (j = 1536; j > 0; j -= 4) {
  	call Leds.set(output);
--- 59,63 ----
  
      call Leds.set(0x7);
!     for (i = 3; i; i--, output >>= 1 ) {
        for (j = 1536; j > 0; j -= 4) {
  	call Leds.set(output);
***************
*** 65,76 ****
    }
  
!   void gestureNotify() {
  
-     uint8_t output = 0x7;
      uint8_t i, j;
  
!     for ( i = 0; i < 6; i++, output = ~output ) {
        call Leds.set(output);
!       for ( j = 0; j < 4; j++ )
  	wait(0xffff);
      }
--- 70,83 ----
    }
  
!   void codeNotify(uint8_t output) {
  
      uint8_t i, j;
  
!     for ( i = 3; i; i-- ) {
        call Leds.set(output);
!       for ( j = 4; j; j-- )
! 	wait(0xffff);
!       call Leds.set(0);
!       for ( j = 4; j; j-- )
  	wait(0xffff);
      }
***************
*** 207,210 ****
--- 214,218 ----
      if ( !call Voltage.okToProgram() ) {
        // give user some time and count down LEDs
+       codeNotify(LEDS_LOWBATT);
        startupLeds();
        runApp();
***************
*** 217,221 ****
      if (++gestureCount >= TOSBOOT_GESTURE_MAX_COUNT - 1) {
        // gesture has been detected, display receipt of gesture on LEDs
!       gestureNotify();
  
        // load golden image from flash
--- 225,229 ----
      if (++gestureCount >= TOSBOOT_GESTURE_MAX_COUNT - 1) {
        // gesture has been detected, display receipt of gesture on LEDs
!       codeNotify(LEDS_GESTURE);
  
        // load golden image from flash



More information about the Tinyos-beta-commits mailing list