5 years, 10 months ago.

mDot capture interrupt wakeUp with interruptIn

Hello,

I just found that when I declare my wakeUp pin, DIO7 or PA_0, as InterruptIn and attach a function to call at the rising edge of an interrupt. The function isn't being called at wakeUp. I think that it may have something to do with mDot's library already using the same pin at default for the wakeUp.

Below is an example of how I am basically using my wakeup pin as an interrupt. It for some reason isn't changing my trigger variable to true at all when an interrupt wakes up my mDot. It wakes up the mDot but I am unable to get it to trigger the function.

InterruptIn wakeup(PA_0);
static bool deep_sleep = false;
bool trigger = false;

void doSomething()
{
    trigger = true;
};
int main()
{
    wakeup.rise(&doSomething);
    while(1)
    {
        if(trigger)
        {
            printf("Triggered\n\r");
            trigger = false;
        }
        wait(2);
        sleep_wake_rtc_or_interrupt(deep_sleep);
    }
}

Thank you.

3 Answers

5 years ago.

Hi.. Is this issue resolved? I am also facing this

5 years, 6 months ago.

Did you ever resolve this issue pls? I believe I am having the same problem.

Hi Mike..

Were you able to resolve this issue?

posted by Ison Thomas 09 Apr 2019
5 years, 10 months ago.

Hi Denwis, Could you please share how are you verifying that you are waking up?

Are you using any debugger setup? If so, are you able to break into the ISR code? When you exit out of the interrupt context, what do you see?

Could you please let us know which board you are using?

Thanks,

Naveen

Team mbed