[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128/timer
Atm128AlarmAsyncP.nc, 1.3, 1.4
David Gay
idgay at users.sourceforge.net
Thu Mar 29 10:12:17 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv19370
Modified Files:
Atm128AlarmAsyncP.nc
Log Message:
fix bug
Index: Atm128AlarmAsyncP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer/Atm128AlarmAsyncP.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Atm128AlarmAsyncP.nc 26 Mar 2007 22:38:39 -0000 1.3
--- Atm128AlarmAsyncP.nc 29 Mar 2007 17:12:15 -0000 1.4
***************
*** 40,44 ****
enum {
! MINDT = 3, /* Minimum interval between interrupts */
MAXT = 230 /* Maximum value to let timer 0 reach
(from Joe Polastre and Robert Szewczyk's
--- 40,44 ----
enum {
! MINDT = 2, /* Minimum interval between interrupts */
MAXT = 230 /* Maximum value to let timer 0 reach
(from Joe Polastre and Robert Szewczyk's
***************
*** 74,77 ****
--- 74,78 ----
if (n == TCNT0)
n++;
+ #if 1
/* Support for overflow. Force interrupt at wrap around value.
This does not cause a backwards-in-time value as we do this
***************
*** 79,82 ****
--- 80,84 ----
if (base + n + 1 < base)
n = -base - 1;
+ #endif
OCR0 = n;
}
***************
*** 148,153 ****
--- 150,157 ----
base += call Compare.get() + 1; // interrupt is 1ms late
setInterrupt();
+ #if 1
if (!base)
overflow();
+ #endif
}
***************
*** 164,168 ****
/* We need to reread TCNT0 as it might've overflowed after we
read TCNT0 the first time */
! now = base + call Counter.get() + 1 + call Timer.get();
else
/* We need to use the value of TCNT0 from before we check the
--- 168,172 ----
/* We need to reread TCNT0 as it might've overflowed after we
read TCNT0 the first time */
! now = base + call Compare.get() + 1 + call Timer.get();
else
/* We need to use the value of TCNT0 from before we check the
***************
*** 174,183 ****
async command bool Counter.isOverflowPending() {
atomic
return (call TimerCtrl.getInterruptFlag()).bits.ocf0 &&
! !(base + call Counter.get() + 1);
}
async command void Counter.clearOverflow() {
atomic
if (call Counter.isOverflowPending())
--- 178,192 ----
async command bool Counter.isOverflowPending() {
+ #if 0
+ return FALSE;
+ #else
atomic
return (call TimerCtrl.getInterruptFlag()).bits.ocf0 &&
! !(base + call Compare.get() + 1);
! #endif
}
async command void Counter.clearOverflow() {
+ #if 1
atomic
if (call Counter.isOverflowPending())
***************
*** 187,190 ****
--- 196,200 ----
setInterrupt();
}
+ #endif
}
More information about the Tinyos-2-commits
mailing list