[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ok, anyone started Contiki 4 AII yet?




Ullrich von Bassewitz wrote:

> Rob <rsteinmetz@mindspring.com> wrote:
> > CLK_TCK is defined in time.h. There is no definition for apple2. You
> > could "spoof" it to see what happens next.
>
> The sources will compile but won't link.

That's pretty much what I expected. At least that indicates that there are no
more missing parts.

> The problem is not CLK_TCK, but the missing clock() function. clock() returns a
> 32 bit value (as implemented in cc65) that represents the CPU time used since
> some arbitrary point of time.
> CLK_TCK (or better CLOCKS_PER_SEC which is the corresponding ISO C constant)
> tells how many of the clock ticks make one second. Since most 6502 machines
> don't do multitasking, CPU time and real time is identical.

OK. I notice that the Atari library has a clock.s file which defines the
clocks_per_sec. I could not locate the definition of the clock() function. This
is what seems to be needed for the Apple ][, either in the Contiki package or in
the cc65. Atari seems to be the only target which has the clock.s file.

> Contiki uses clock() and CLK_TCK to implement timers. For example the TCP
> stack needs timers to keep track of connection timeouts, packet retransmit
> timeouts and so on. Without having a function that is able to measure time in
> some way or the other, there is no way to implement a TCP stack.
>
> Regards
>
>         Uz

CLK_TCK is pretty easy and could be added to the cc65 time.h file. Defining
clock() for the Apple ][ it seems is the key.

--
Robert Steinmetz AIA
Principal
Steinmetz & Associates