|
From: | George Kalovyrnas |
Subject: | Re: [avr-gcc-list] SREG save? |
Date: | Tue, 14 Dec 2004 16:43:18 +0200 |
User-agent: | Mozilla Thunderbird 0.9 (Windows/20041103) |
David Kelly wrote:
On Dec 14, 2004, at 7:09 AM, Mattias Svensson wrote:As i recall: INTERRUPT() runs with global interrupts enabled. SIGNAL() runs with global interrupts disabled.Am away from my .pdf's at the moment but I'm quite sure Mattias is correct. That the usage is opposite of Codevision.
Yes, actualy Mattias is correct.
What I'd research is how the AVR prepares itself for an IRQ and then recovers with RTI. I would expect the I bit is disabled automatically and restored on RTI.
In AVR, the interrupts are disabled automatically when an interrupt occurs. The GCC compiler saves the SREG in the stack, along with "zero_reg" and "tmp_reg". In the case of the INTERRUPT service routine the global interrupts are enabled, before the SREG is saved, while in the SIGNAL case are not enabled. That is actually the difference between the two ISR implementations.
George Kalovyrnas Athens, Greece
[Prev in Thread] | Current Thread | [Next in Thread] |