[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Ok, anyone started Contiki 4 AII yet?
Adam Dunkels wrote:
> On Tue, 18 Mar 2003 19:20:04 +0100, Ullrich von Bassewitz wrote:
> > Rob <rsteinmetz@mindspring.com> wrote:
>
>
> The nice thing is that the time measurements does not have to be very
> precise. Contiki calls the clock() function as part of the idle time
> processing loop (which also check the keyboard for input and any
> network devices for incoming data), and I wouldn't be surprised if it
> would be enough for Contiki to let clock() return a 32-bit integer
> that would be incremented by 1 for every call to clock(). I.e.,
> something like this:
>
> unsigned long
> clock(void) {
> static unsigned long counter;
>
> return ++counter;
> }
>
> CLK_TCK would then have to be tuned to a value that roughly
> corresponds to one second. Of course, this timer would drift a lot
> when there is activity going on, but it might be good enough for the
> TCP timers.
>
> /adam
> --
> Adam Dunkels - http://dunkels.com/adam/
This has the advantage of being simple to implement and being universal, if it
works it would work on every type of machine, assuming an appropriate value of
CLK_TCK.
It could be a default, with other options available if the hardware is present,
either at compile time or runtime, although this may affect the size of the
program.
Is it possible to adjust CLK_TCK externally to Contiki? It looks like it is set
at compile time.
If I could only get cc65 going on my machine :-/
--
Rob Steinmetz