[Tinyos-devel] LocalTime interface
Jeongyeup Paek
jpaek at usc.edu
Mon Dec 3 11:55:28 PST 2007
If I were you, I would just write a new component and a new interface.
NewComponenet64 uses 32-bit LocalTime,
and take care of wrap-around internally.
NewInterface64 will have one command
error_t get64(uint32_t *hi, uint32_t *lo);
What is the issue here?
Thanks
- jpaek
Andreas Koepke wrote:
> Since the semantic meaning of an interface is in its name, moving to
> Counter would no do, at least w.r.t the tinyos philosophy.
>
> 2. is not possible: the return type is not (yet?) generic
>
> Miklos Maroti:
>> Obviously you need a new interface for that: say LocalTime64 or
>> something,
>> but maybe it would be better to
>>
>> 1) use the generic Counter interface for this, or
>> 2) move LocalTime to generic as well.
>>
>> Miklos
>>
>> On Dec 3, 2007 3:05 PM, Andreas Koepke <koepke at tkn.tu-berlin.de> wrote:
>>> But how do I call LocalTime.get() on this component? It will reduce the
>>> value back to 32 bit...
>>>
>>> Miklos Maroti:
>>>
>>>> Hi Andreas,
>>>>
>>>> Use TransformCounterC to get a 64-bit counter, then write your
>>>> version of localtime similar to CounterToLocalTimeC. All this
>>>> is from lib/timer. (Or you would easily do this by hand and
>>>> with a periodic timer that gets executed at least once at every
>>>> 0.75 days to notice that you are close to overflow on the 32-bit
>>>> integer).
>>>>
>>>> Best,
>>>> Miklos
>>>>
>>>> On Dec 3, 2007 2:49 PM, Andreas Koepke <koepke at tkn.tu-berlin.de> wrote:
>>>>> Hi guys, I'm experimenting a little with synchronization and use the
>>>>> 32kHz clock for this. Unfortunately, the LocalTime interface is
>>>>> only 32
>>>>> bit wide, so that I have to handle clock wraps every 1.5 days. What
>>>>> would be the best way to introduce a 64 bit wide LocalTime interface?
>>>>>
>>>>> Best regards, Andreas
>>>>>
>>>>> _______________________________________________
>>>>> Tinyos-devel mailing list
>>>>> Tinyos-devel at Millennium.Berkeley.EDU
>>>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>>>>>
>>>>>
>>>
>>
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
--
Jeongyeup Paek
Ph.D. student
Embedded Networks Laboratory
Department of Computer Science
University of Southern California
http://enl.usc.edu/~jpaek
More information about the Tinyos-devel
mailing list