[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/timer VirtualizeTimerC.nc, 1.3, 1.4

Cory Sharp cory at moteiv.com
Tue Aug 8 16:04:52 PDT 2006


David, I think you may have accidentally left in a couple of lines of
garbage in this commit:

+     if (dosleep)
+       t3 = TCNT3 - tt0;

Cory

On 8/8/06, David Gay <idgay at users.sourceforge.net> wrote:
> Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/timer
> In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10968
>
> Modified Files:
>         VirtualizeTimerC.nc
> Log Message:
> simplify timer virtualisation logic a bit
>
>
> Index: VirtualizeTimerC.nc
> ===================================================================
> RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/timer/VirtualizeTimerC.nc,v
> retrieving revision 1.3
> retrieving revision 1.4
> diff -C2 -d -r1.3 -r1.4
> *** VirtualizeTimerC.nc 7 Aug 2006 22:18:21 -0000       1.3
> --- VirtualizeTimerC.nc 8 Aug 2006 22:46:29 -0000       1.4
> ***************
> *** 79,83 ****
>         int32_t elapsed = then - timer->t0;
>         int32_t remaining = timer->dt - elapsed;
> -       bool compute_min_remaining = TRUE;
>
>         // If the elapsed time is negative, then t0 is in the future, so
> --- 79,82 ----
> ***************
> *** 91,95 ****
>           {
>             timer->isrunning = FALSE;
> -           compute_min_remaining = FALSE;
>           }
>           else
> --- 90,93 ----
> ***************
> *** 104,114 ****
>         }
>
> !       // check isrunning in case the timer was stopped in the fired event
> !
> !       if (compute_min_remaining && timer->isrunning)
>         {
> !           if (remaining < 0)
> !             min_remaining = 0;
> !         else if (remaining < min_remaining)
>             min_remaining = remaining;
>           min_remaining_isset = TRUE;
> --- 102,113 ----
>         }
>
> !       // check isrunning in case the timer was stopped in the fired
> !       // event or this was a one shot timer; note that a one shot
> !       // timer that was restarted in its fired event will push us
> !       // through here with remaining < 0, but we've already scheduled
> !       // an executeTimers in that case
> !       if (timer->isrunning)
>         {
> !         if (remaining < min_remaining)
>             min_remaining = remaining;
>           min_remaining_isset = TRUE;
> ***************
> *** 121,129 ****
>         uint32_t now = call TimerFrom.getNow();
>         uint32_t elapsed = now - then;
> !       if (min_remaining <= elapsed)
>         post executeTimersNow();
>         else
>         call TimerFrom.startOneShotAt(now, min_remaining - elapsed);
>       }
>     }
>
> --- 120,130 ----
>         uint32_t now = call TimerFrom.getNow();
>         uint32_t elapsed = now - then;
> !       if (min_remaining < 0 || (uint32_t)min_remaining <= elapsed)
>         post executeTimersNow();
>         else
>         call TimerFrom.startOneShotAt(now, min_remaining - elapsed);
>       }
> +     if (dosleep)
> +       t3 = TCNT3 - tt0;
>     }
>
>
> _______________________________________________
> Tinyos-2-commits mailing list
> Tinyos-2-commits at mail.millennium.berkeley.edu
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2-commits
>


More information about the Tinyos-2-commits mailing list