[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to do context saving manually in ISR(__vector_nam
Re: [avr-gcc-list] How to do context saving manually in ISR(__vector_name)
Wed, 24 Dec 2008 11:20:58 +0100
Maybe it is an idea to try the OS_task attribute instead of naked.
__attribute__ (( OS_task ))
I did not try it for ISR but for standard methodes is does just
that, it makes it naked, but creates a stack frame when needed.
If you cannot use it on an interrupt handler directly, just make a
seperate method with the attribute, and call that from your
Let me know if it worked.
On Wednesday 24 December 2008 03:21, Lin Nan wrote:
> Hello, every one.
> In my program, I have some reason that it is better to save all the
> registers including r0 to r31 and SREG to stack. So, I used the
> ISR(VECT_NAME, ISR_NAKED) way to create ISRs.
> But I found if there are some local variables in ISR handler, the Stack
> Pointer is saved to r29:r28 and decrease to create a new stack frame when
> using non-naked ISR.
> I wonder how I can do this manually since I don't know how to get the size
> of local variables.