cancel
Showing results for 
Search instead for 
Did you mean: 

how to suspend and resume an external interrupt?

Mario Luzeiro
Senior
Posted on September 20, 2010 at 14:06

how to suspend and resume an external interrupt?

3 REPLIES 3
lowpowermcu
Associate II
Posted on May 17, 2011 at 15:10

Hi Luzeiro,

Try to use enableInterrupts() and disableInterrupts().

Tell me if it is OK. That interests me !

Good luck !

Ciao,

MCU Lüfter

Mario Luzeiro
Senior
Posted on May 17, 2011 at 15:10

I dont think disable all interrupts is a good ideia so it possible disables all priority interrupts.

I found that for the external pin example, the STM8L have several types of interrpts, that is: fallen edge and low, fallen edge, rise edge, rise edge and high.

that means I expect use onde ''edge and..'' if I enable the interrupt after the edge event ocours, the line is still low or high so the event will be attended.

I didnt test it, but I hope it works..

MRL

lowpowermcu
Associate II
Posted on May 17, 2011 at 15:10

Hi luzeiro,

If I have well read the spec, there is four types: rising, falling, rising and falling, falling and low level.

I think that only falling and low level can suits you.

Using ''enableInterrupts() and disableInterrupts()''don't clear the interrupt pending bit.

critial_function()

{

disableInterrupts()

code...

                                    //<<<--- event interrupt

code...

code...

enableInterrupts();

}                                    // <<<--- ISR called so event is not missed

Regards,

MCU Lüfter