[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] delay in microseconds [Was: Adding new device to LibC
Re: [avr-libc-dev] delay in microseconds [Was: Adding new device to LibC]
Wed, 15 Jan 2003 10:30:58 -0700
On 15 Jan 2003 at 18:01, Joerg Wunsch wrote:
> As E. Weddington wrote:
> > Jörg, Ted, do you remember what this todo item was all about?
> It is based on a remark from Marek at the end of include/avr/delay.h.
> > Especially the tag about the floating point math stuff.
> That just means that e. g. 15 µs * 8.0 MHz will be computed at
> compile-time if done properly, so no floating-point run-time support
> is needed.
Thanks for the refresh!
> The use of hardware timers is rather up to the application
> implementor. I can however provide an implementation for dynamically
> configurable one-shot timers (i. e., no predefined number of timer
> slots, each timer is allocated using malloc()) that should be fairly
> portable. It relies on the application calling a function
> timer_tick() per each hardware timer tick, and the argument to the
> "timeout()" function (which will start a new one-shot timer) is
> measured in hardware timer ticks. Timers can be cancelled before they
> expire, and will execute a callback function upon expiry (which can e.
> g. start a new timer if repeatable timers are desired).
> I think i've already posted this implementation once here, but got no
> response. I might convert that into a doc/example subdirectory, but
> i've already promised to do a doc/example/stdio first. ;-)
Yes, I remember seeing your implementation here a couple of times.
For personal reasons, I shy away from having to use malloc and that
particular scheme when all I really need is some simple, reliable
delays. But that's just me; I don't doubt that others might need your
The time frame / ordering for example writing is up to you! I'll look
forward to any and all!