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

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

Re: [avr-libc-dev] [bug #35003] wdt_enable() has a wrong code sequencefo


From: Lou Cypher
Subject: Re: [avr-libc-dev] [bug #35003] wdt_enable() has a wrong code sequencefor many parts
Date: Wed, 07 Dec 2011 17:39:41 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Hello,

based on a feature
only partially documented by silicon manufacturer.

The following quote is from doc0856.pdf "AVR Instruction Set" (and is valid for 
all AVRs, including the XMEGAs, btw.):

SEI - Set Global Interrupt Flag
Description:
Sets the Global Interrupt Flag (I) in SREG (Status Register). The instruction 
following SEI will be executed before any pend-
ing interrupts.


Do you find that a sufficient documentation of this feature?

If the original text read as
"The instruction following a set of the Global Interrupt Flag (I) in SREG will be executed before any pending interrupts." and it was mentioned separated from description of SEI instruction, then I would have found it a sufficient documentation for the feature.

I just noted that specifying it only in paragraph dedicated to SEI instruction can mislead to think it's related to SEI instruction decoding. While as others pointed out, it's related to I-flag setting, anyway you obtain it (in this case with an OUT instruction). Maybe it should have been included in the section about interrupt handling or CPU core.

In the end, my /surprise/ was to discover that OUT could have some _side_ effects as with SEI instruction (I was unaware or I forgot about it, don't know). My /disappoint/ is that the same source file uses two coding styles (SREG restore before or after the last instruction meant to be safely executed). My criticism is that in the AVR manuals the I-flag setting should have been mentioned in the general CPU section.
That's all.

Thanks for all the answers: they show that even the smallest report is read by a lot of people!

L

____________________________________________________________
Send any screenshot to your friends in seconds...
Works in all emails, instant messengers, blogs, forums and social networks.
TRY IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if2 for FREE





reply via email to

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