avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] Readming TCNT1 (__inw_atomic)


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] Readming TCNT1 (__inw_atomic)
Date: Thu, 28 Aug 2003 10:08:42 +0200 (MET DST)

As "Derick Schoonbee" <address@hidden> wrote:

>Is __inw_atomic "valid" ?

No, it has been dropped some time ago.  I think there's been a bit of
discussion about it in the avr-libc developers list, but i'm not sure.

>Or do I just need to follow the guidelines @ 
>http://savannah.nongnu.org/download/avr-libc/doc/avr-libc-user-manual/FAQ.html#faq_16bitio
> 
>?

If it's in the official FAQ, you can take that for granted. ;-)

Yep, do it as it's written there.  Well, but remember that this
example is meant for situations where it's not clear to the caller
whether global interrupts are currently enabled or not.  If you are
certain they /are/ enabled (e. g. usually inside main()), you can
simplify that by explicitly using cli() and sei() around the code.
The distinction was one of the reasons to drop the *_atomic() macros,
IIRC; it's better if the programmers think about what they actually
need (as you're just doing ;) than blindly relying on something where
the name promises it might be what they want.
-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/


reply via email to

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