avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] (Fwd) WinAVR 20030424


From: E. Weddington
Subject: Re: [avr-libc-dev] (Fwd) WinAVR 20030424
Date: Mon, 05 May 2003 09:49:47 -0600

On 3 May 2003 at 9:55, Joerg Wunsch wrote:

> As E. Weddington wrote:
> 
> > 1.Corrections are needed to the io86r401.h file to match the latest
> > data sheet (03/03) see attached edited file.
> 
> Eric, perhaps you can verify this against the datasheet, and commit?

Sure. Easy enough.

 
> > 3. A section of the interrupt.h file contains the following
> > 
> > extern inline void enable_external_int (unsigned char ints)
> > {
> > #if defined(EIMSK)
> >  EIMSK = ints;
> > #elif defined(GIMSK)
> >  GIMSK = ints;
> > #elif defined(GICR)
> >  GICR = ints;
> > #else
> > # error "No valid external interrupt control register defined."
> > #endif
> > }
> 
> I think we should completely deprecate that interface, and only make
> it available for backwards compatibility as part of
> <compat/interrupt.h> or something along that line.  These
> enable_external_int() (and enable_timer_int()) interfaces are
> fundamentally flawed anyway, in particular since you cannot add or
> remove just /one/ interrupt, but have to provide the complete
> interrupt mask anyway, so you need to explicitly know which other bits
> are already set and must not be clobbered.
> 
> If at all, we should start with the long treatened <compat/io.h>
> interface that defines the smallest common denominator for the various
> AVR IO definitions.  That would be the place to say something like:
> 
> #if !defined(EIMSK) && defined(GIMSK)
> #define EIMSK GIMSK
> #endif
> #if !defined(EIMSK) && defined(GICR)
> #define EIMSK GICR
> #endif
> 
> thus supplying a common EIMSK pseudo-register independent of the
> underlying AVR device (if possible at all).


But in the meanwhile, as a stopgap, can we change the #error to 
#warning? Or just drop that branch and let it compile to nothing; 
it's harmless if those registers aren't defined.

Eric




reply via email to

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