[Tinyos-devel] Bug in timer system
Cory Sharp
cory at sentilla.com
Tue Mar 4 11:12:10 PST 2008
> From: Philip Levis <pal at cs.stanford.edu>
> Date: Tue, Mar 4, 2008 at 9:50 AM
> Subject: Re: [Tinyos-devel] Bug in timer system
> To: Jan Hauer <jan.hauer at gmail.com>
> Cc: TinyOS Development <tinyos-devel at millennium.berkeley.edu>
>
> On Mar 4, 2008, at 7:54 AM, Jan Hauer wrote:
>
> > FYI: the timer.fired() bug has been reported before
> > (http://sourceforge.net/tracker/index.php?
> > func=detail&aid=1572439&group_id=28656&atid=393934)
> > - and Michiel Konstapel claims that they have send a bug report to the
> > mailing list some time ago also - let's fix this now !!!
> >
>
> Agreed. Part of the issue is that the author of the timer library is
> no longer actively supporting it, so it fell on the floor.
>
Nice try, but the last commit I made, this bug wasn't present. Since then,
useful comments have been removed and bugs introduced during its
"refactoring" by someone else. For instance, this was in my commit on 26
Jul 2006.
// Calculate "remaining" before the timer is fired. If a timer
// restarts itself in a fired event, then we 1) need a consistent
// "remaining" value to work with, and no worries because 2) all
// start commands post executeTimersNow, so the timer will be
// recomputed later, anyway.
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
// don't process it. This implies:
// 1) t0 in the future is okay
// 2) dt can be at most maxval(uint32_t)/2
if ((elapsed >= 0) && (timer->dt <= (uint32_t)elapsed))
> Can you validate that the suggested fix? If you do, I'll commit it
> (or you can...).
>
> Phil
>
Perhaps after reviewing the commit log to ensure there weren't any actual
bugs fixed since then, you should just revert to my original version?
Cory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20080304/9d2d26ea/attachment.html
More information about the Tinyos-devel
mailing list