[Top][All Lists]

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

AW: [avr-gcc-list] reentrant interrupt service routine

From: Sven Schlender
Subject: AW: [avr-gcc-list] reentrant interrupt service routine
Date: Tue, 1 Apr 2008 22:14:30 +0200

Hi again,

>       Interrupts are disabled while they are executed. This way
> interrupt are
> by default executed without nesting. If you like to nest interrupts you
> have to reenable interrupts within your interrupt service handler using
> eg. sei(). I use this schema and it works without complains. You just
> have to be careful with your stack as the interrupt service which
> enables other interrupts an be called again and then lock the mcu.

So far I know.
There is another (or maybe the same) problem I think about. Lets say there
is function which is callable from main() AND from any interrupt routine.
Than you have the possibility while executing this function that due a
rising interrupt, this function is executed again in parallel manor (its
like a hidden recursion).
It is possible that some state (stored in a register or file) of the
function gets corrupted through the second call than? From where knows the
compiler which register are to stored on the stack if a interrupt is rising?
Do the compiler check for such a situation (maybe with a call tree), in case
it can produce potential problems?

Regards, Sven.

reply via email to

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