Skip to main content
Visitor II
September 20, 2010
Question

how to suspend and resume an external interrupt?

  • September 20, 2010
  • 3 replies
  • 938 views
Posted on September 20, 2010 at 14:06

how to suspend and resume an external interrupt?

    This topic has been closed for replies.

    3 replies

    Visitor II
    May 17, 2011
    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

    Visitor II
    May 17, 2011
    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

    Visitor II
    May 17, 2011
    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