[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX/sensors CoulombCounterP.nc, 1.1, 1.2 CoulombCounter.nc, 1.1, 1.2

akoepke andreaskoepke at users.sourceforge.net
Thu Dec 6 10:33:04 PST 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/sensors
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15877/sensors

Modified Files:
	CoulombCounterP.nc CoulombCounter.nc 
Log Message:
simplified interface


Index: CoulombCounterP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/sensors/CoulombCounterP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CoulombCounterP.nc	24 Jul 2007 12:37:39 -0000	1.1
--- CoulombCounterP.nc	6 Dec 2007 18:33:02 -0000	1.2
***************
*** 50,58 ****
  }
  implementation {
! #define MIN_DELAY 30
      
      uint16_t timerHighBits = 0;
      uint32_t dur = 0;
! 
      void resetBoard() {
          call ResetBoard.set();
--- 50,59 ----
  }
  implementation {
! #define MIN_DELAY 60
      
      uint16_t timerHighBits = 0;
      uint32_t dur = 0;
!     bool warned = FALSE;
!     
      void resetBoard() {
          call ResetBoard.set();
***************
*** 107,116 ****
      }
      
!     command error_t CoulombCounter.startMeasurement(uint32_t delay, uint32_t duration) {
          error_t result = SUCCESS;
          
          timerHighBits = duration >> 22;
          dur = duration * (uint32_t)1024;
!         
          if(call CoulombCounter.isMeasureing()) {
              startLongTimer();
--- 108,117 ----
      }
      
!     command error_t CoulombCounter.start(uint32_t delay, uint32_t duration) {
          error_t result = SUCCESS;
          
          timerHighBits = duration >> 22;
          dur = duration * (uint32_t)1024;
!         warned = FALSE;
          if(call CoulombCounter.isMeasureing()) {
              startLongTimer();
***************
*** 129,133 ****
  
      /** Stop a measurement, returns FAIL if there is no ongoing measurement */
!     command error_t CoulombCounter.stopMeasurement() {
          error_t result = FAIL;
          call Timer.stop();
--- 130,134 ----
  
      /** Stop a measurement, returns FAIL if there is no ongoing measurement */
!     command error_t CoulombCounter.stop() {
          error_t result = FAIL;
          call Timer.stop();
***************
*** 152,157 ****
              }
              else {
!                 // measurement finished
!                 call CoulombCounter.stopMeasurement();
              }
          }
--- 153,164 ----
              }
              else {
!                 if(warned == TRUE) {
!                     call CoulombCounter.stop();
!                 }
!                 else {
!                     signal CoulombCounter.soonOver();
!                     call Timer.startOneShot((uint32_t)MIN_DELAY*1024);
!                     warned = TRUE;
!                 }
              }
          }

Index: CoulombCounter.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/sensors/CoulombCounter.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CoulombCounter.nc	24 Jul 2007 12:37:39 -0000	1.1
--- CoulombCounter.nc	6 Dec 2007 18:33:02 -0000	1.2
***************
*** 47,56 ****
       *  allows us to "continue" measureing.
       */
!     command error_t startMeasurement(uint32_t delay, uint32_t duration);
  
      /** Stop a measurement, returns FAIL if there is no ongoing measurement */
!     command error_t stopMeasurement();
  
      /** notification: a fixed portion of energy has been consumed */
      async event void portionConsumed();
  }
--- 47,59 ----
       *  allows us to "continue" measureing.
       */
!     command error_t start(uint32_t delay, uint32_t duration);
  
      /** Stop a measurement, returns FAIL if there is no ongoing measurement */
!     command error_t stop();
  
      /** notification: a fixed portion of energy has been consumed */
      async event void portionConsumed();
+ 
+     /** notification that the measurement will be soon over */
+     event void soonOver();
  }



More information about the Tinyos-2-commits mailing list