This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sd_app_evt_wait();

Hi

I'm using sd_app_evt_wait(); to go into low_power mode. For some reason it comes back immediately, but I can't figure out why.

If I call it a second time it stays asleep as it should. Is there any way to see why sd_app_evt_wait(); comes back again?

I have tried to put breakpoints in all my handlers, but no hit there. Adding a delay before the first call didn't help either.

Best regards /Håkan

  • This note in the documentation for sd_app_evt_wait(); may explain what you are seeing: "If an application interrupt has happened since the last time sd_app_evt_wait was called this function will return immediately and not go to sleep. This is to avoid race conditions that can occur when a flag is updated in the interrupt handler and processed in the main loop."

    The only other alternative is you have a disabled interrupt with its pending flag set. That seems less likely since you do not mention clearing any pending interrupt flags.

Related