[Tinyos-host-mote-wg] Re: [Tinyos-2.0wg] Timer.fired
Cory Sharp
cory.sharp at gmail.com
Mon May 23 13:33:05 PDT 2005
On 5/23/05, Philip Levis <pal at cs.berkeley.edu> wrote:
> On May 23, 2005, at 11:30 AM, Cory Sharp wrote:
> Ah, OK. I think I understand. Your description is a little unclear.
> If I have it wrong, let me know and I'll just look at the code. The
> state it keeps is "last time I fired." From this it can determine how
> many firings remain, up to time wraparound, etc.?
Yeah, I opted for brevity over verbose clarity. You've got it pretty
much right.
Note that there are five pieces of state per timer that you just must have:
uint8_t id
uint32_t t0
uint32_t dt
bool is_periodic
bool is_running
id isn't kept around because it's implicit in the wiring/indexing.
t0+dt is when a timer will or did fire ("last time I fired").
Everything is calculated from those five state values. You can look
at the code in tos/lib/timer/VirtualizeTimerC.nc -- there's not a
whole lot of code there.
Cory
_______________________________________________
Tinyos-2.0wg mailing list
Tinyos-2.0wg at Mail.Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-2.0wg
More information about the Tinyos-host-mote-wg
mailing list