Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 5 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
6 years, 5 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