[Tinyos Core WG] TEP102 and binary vs decimal units

Joe Polastre joe at polastre.com
Tue May 22 09:31:56 PDT 2007


Why would a "local time" ever be represented in nx_ types?  Seems like
a blatent waste of resources and code space.

-Joe

On 5/22/07, Kevin Klues <klueska at gmail.com> wrote:
> >
> > Oh, and one more. Any objections to adding LocalTimeMilliC to the HIL
> > requirements (provides LocalTime)? Was proposed by Cory, but hasn't
> > been implemented or described in the TEP:
> >
>
> It might make sense to extend the LocalTime interface to be able to
> hold a time larger than 32 bits, as well as perform a number of
> operations on the local time.
>
> i.e.
> typedef nx_struct local_time16 {
>   nx_uint16_t sticks; /* s: Ticks of 16 bit counter */
>   nx_uint32_t mticks; /* m: Ticks incremented upon overflow of 16 bit counter */
> } local_time16_t;
>
> typedef nx_struct local_time32 {
>   nx_uint32_t sticks; /* s: Ticks of 32 bit counter */
>   nx_uint32_t mticks; /* m: Ticks incremented upon overflow of 32 bit counter */
> } local_time32_t;
>
> interface LocalTimeExtended<precision_tag, local_time_t> {
>         async command local_time_t getNow();
>         async command local_time_t add(local_time_t* t1, local_time_t* t2);
>         async command local_time_t sub(local_time_t* t1, local_time_t* t2);
>         async command int8_t compare(local_time_t* t1, local_time_t* t2);
>         async command bool lessThan(local_time_t* t1, local_time_t* t2);
>         async command bool greaterThan(local_time_t* t1, local_time_t* t2);
>         async command bool equal(local_time_t* t1, local_time_t* t2);
> }
>
> Kevin
> _______________________________________________
> 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-2.0wg mailing list