[Tinyos-devel] improving FTSP interface
Miklos Maroti
mmaroti at math.u-szeged.hu
Thu Aug 7 13:26:35 PDT 2008
>> >>> so to make it easier for app developers, FTSP can provide
>> >>> isRollover(uint32_t current_time) command that implements this, right?
>> >>>
>> >>> one scenario, where rollover would be useful is when your application
>> >>> runs for a long time and doesn't query ftsp's global time very often.
>> >>> 33rd bit could flip twice without the app realizing it, while rollover
>> >>> bit would stay set. for 32khz clock (hopefully provided soon), this
>> >>> would mean 4.5 hours which is not totally unreasonable. ftsp could
>> >>> realize the rollover because it receives periodic timesync messages.
>> >>>
>> >>> brano
>> >> Another solution would be to provide an overflow "interrupt" like the
>> >> Counters.
>> >>
>> >
>> > Commenting on the interface - an interface such as this or the one
>> > that Brano suggested should work.
>> >
>> > It just does not make sense for an application to make indirect
>> > inferences which can be error prone.
>> agreed. especially - miklos's code is usually correct and very
>> efficient, but hard to understand. i bet only 50% of people will
>> understand what he proposed above, and less than 1% will understand the
>> comment that the code will always work (and the reason for it). :)
>>
>> any preferences on pull vs push? i'm personally on the pull side
>> (isRollover) - this allows you to check rollover of any timestamp at any
>> place in your code. as opposed to forcing everybody to wire yet another
>> event.
>>
>> brano
>
> Push has the advantage that you can maintain a 64 bit clock on top of
> it. Just my 2c.
>
>
You need to have the last global time and current global time. So if
you want to have a command for this, then the user has to maintain the
last global time or you need to parametrize the interface. It should
be an event, then a single last global time (the FTSP already has
this) should be sufficient.
Miklos
More information about the Tinyos-devel
mailing list