Dear Wolfgang Denk,

> Dear Reinhard Meyer,
>
> In message<4de4743c.5040...@emk-elektronik.de>  you wrote:
>>
>> Exactly! And (saying it silently) this would not mandate that the now hidden 
>> internal
>> timer needs to be in ms units, it could be the bare "natural" tick of the 
>> hardware...
>
> Yes. We can throw everything away and restart evolution from the
> amoeba, or even with a big bang.

All you can throw into the timer discussion is critics and pointless remarks,
but I miss any productive input from you except sometimes pointing out how
powerpc does it.

>
> Are we discussing API changes or a complete rewrite of everything?

We DO have most of the tick based functions in the current API...

And as it seems, the current ms based API is a Pandora's box of problems:
- granularity problems in some hardware
- early timeouts that need complicated solutions inside the loop
- complicated algorithms to convert a natural, non-ms tick into ms values

All this would go if the timer would be left in natural ticks of the hardware
and simple helper functions be used to convert to and from that to ms, if so
desired:

tick_t start = get_tick();
...
tick_t end = get_tick();

printf("Elapsed time in ms: %u", ticks2ms(end - start));

OR:

tick_t end_tick = time_get_future_tick(1234);
/* parameter is in ms, tick will be calculated such that it causes at least xxx 
ms delay */

while (!tick_reached(end_tick))
   ...

Perhaps just too simple and too brilliant...

Best Regards,
Reinhard
_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to