[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128/timer Atm128AlarmAsyncP.nc, 1.1, 1.2

David Gay idgay at users.sourceforge.net
Mon Mar 26 14:46:04 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv25862

Modified Files:
	Atm128AlarmAsyncP.nc 
Log Message:
wrap around support


Index: Atm128AlarmAsyncP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer/Atm128AlarmAsyncP.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Atm128AlarmAsyncP.nc	26 Mar 2007 21:23:20 -0000	1.1
--- Atm128AlarmAsyncP.nc	26 Mar 2007 21:46:01 -0000	1.2
***************
*** 15,28 ****
    uint8_t set;
    uint32_t t0, dt;
!   uint32_t base, lastNow;
! 
!   void oopsT0() {
!   }
! 
!   void oopsNow() {
!   }
  
    enum {
!     MINDT = 10,
      MAXT = 230
    };
--- 15,22 ----
    uint8_t set;
    uint32_t t0, dt;
!   uint32_t base;
  
    enum {
!     MINDT = 2,
      MAXT = 230
    };
***************
*** 51,60 ****
  	  {
  	    uint32_t now = call Counter.get();
! 	    if (now < t0) 
! 	      {
! 		oopsT0();
! 		t0 = now;
! 	      }
! 	    if (now - t0 >= dt)
  	      {
  		set = FALSE;
--- 45,50 ----
  	  {
  	    uint32_t now = call Counter.get();
! 
! 	    if ((uint32_t)(now - t0) >= dt)
  	      {
  		set = FALSE;
***************
*** 113,123 ****
  	else
  	  now = base + now8;
- 
- 	if (now < lastNow)
- 	  {
- 	    oopsNow();
- 	    now = lastNow;
- 	  }
- 	lastNow = now;
        }
      return now;
--- 103,106 ----



More information about the Tinyos-2-commits mailing list