[Top][All Lists]

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

Re: [avr-libc-dev] timer.h

From: E. Weddington
Subject: Re: [avr-libc-dev] timer.h
Date: Mon, 30 Sep 2002 10:23:06 -0600

On 30 Sep 2002 at 18:14, Joerg Wunsch wrote:

> As E. Weddington wrote:
> > > IMHO, we should drop this file.  It's incomplete enough so i doubt
> > > anybody is actually using it at all.
> > > 
> > > Opinions?
> > > 
> > 
> > Please, drop it.
> Would anybody here object?
> > Or, make it totally complete and worthwhile to use.
> IMHO, it's hard to even make it `complete', since the notion of
> completeness might vary much between different environments.  Also,
> newer ATmegas use different names for the bit descriptions.
That's what conditional compilation is for. ;-)

> > I'm sure that there would be people interested in 
> > a timer module. If AVRGCC doesn't provide it, they'll have to roll
> > their own anyway. If AVRGCC does provide it, then it will save
> > programming time.
> Well, since all the contained functions are one-liners anyway, i guess
> the need to rewrite them is not more than just the "programmer's
> warm-up" before actually starting even the simplest AVR project. ;-)
> > I have some code that might be a starting point for a timer module. 
> In what sense?
> I've got a timer module as well, but one that's fairly hardware
> independent.  I need to polish it up a bit, and will post it here.
> Basically, it's an implementation for one-shot timers that can trigger
> a callback function, and that also can be cancelled before they are
> expired.  (Repeated timers can easily be achieved by re-adding a new
> timer event within the callback.)  Hardware independence is maintained
> by simply providing a function timertick() that needs to be called by
> an actual timer interrupt service.  (In the application i wrote this
> for, the timer ISR does a bit more than only calling this function, e.
> g. it fetches the current value of another counter channel into a
> temporary variable since this action is time-critical.)
> I intent to at least supply these functions for the "examples" section
> of the avr-libc documentation.

In the sense of a simple API interface to the AVR timer subsystem. 
This doesn't implement a "timer" per se, as your module does. I leave 
that for other modules that call the timer API, i.e. delay functions, 
PWM functions.

Hey, I'm getting deja-vu all over again :-).... Didn't we discuss 
this before, with you posting that code?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]