[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/atm128/timer
Atm128AlarmAsyncP.nc, 1.6, 1.7
Phil Levis
scipio at users.sourceforge.net
Wed Jun 20 16:49:04 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv21302/chips/atm128/timer
Modified Files:
Atm128AlarmAsyncP.nc
Log Message:
Added AM group.
Index: Atm128AlarmAsyncP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/atm128/timer/Atm128AlarmAsyncP.nc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Atm128AlarmAsyncP.nc 29 Mar 2007 21:29:33 -0000 1.6
--- Atm128AlarmAsyncP.nc 20 Jun 2007 23:49:02 -0000 1.7
***************
*** 98,112 ****
uint8_t interrupt_in = 1 + call Compare.get() - call Timer.get();
uint8_t newOcr0;
!
! if (interrupt_in < MINDT || (call TimerCtrl.getInterruptFlag()).bits.ocf0)
return; // wait for next interrupt
/* When no alarm is set, we just ask for an interrupt every MAXT */
! if (!set)
newOcr0 = MAXT;
else
{
uint32_t now = call Counter.get();
!
/* Check if alarm expired */
if ((uint32_t)(now - t0) >= dt)
--- 98,122 ----
uint8_t interrupt_in = 1 + call Compare.get() - call Timer.get();
uint8_t newOcr0;
! uint8_t tifr = (uint8_t)((call TimerCtrl.getInterruptFlag()).flat);
! dbg("Atm128AlarmAsyncP", "Atm128AlarmAsyncP: TIFR is %hhx\n", tifr);
! if ((interrupt_in != 0 && interrupt_in < MINDT) || (tifr & (1 << OCF0))) {
! if (interrupt_in < MINDT) {
! dbg("Atm128AlarmAsyncP", "Atm128AlarmAsyncP: under min: %hhu.\n", interrupt_in);
! }
! else {
! dbg("Atm128AlarmAsyncP", "Atm128AlarmAsyncP: OCF set.\n");
! }
return; // wait for next interrupt
+ }
/* When no alarm is set, we just ask for an interrupt every MAXT */
! if (!set) {
newOcr0 = MAXT;
+ dbg("Atm128AlarmAsyncP", "Atm128AlarmAsyncP: no alarm set, set at max.\n");
+ }
else
{
uint32_t now = call Counter.get();
! dbg("Atm128AlarmAsyncP", "Atm128AlarmAsyncP: now-t0 = %llu, dt = %llu\n", (now-t0), dt);
/* Check if alarm expired */
if ((uint32_t)(now - t0) >= dt)
More information about the Tinyos-2-commits
mailing list