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

app_sched_execute followed by sd_app_evt_wait

Hello,

I am working on a project based on the nRF51822 with the softdevice S110.

I am trying to develop an application using the main loop provided in an example application:

// Enter main loop
for (;;)
{
    app_sched_execute();
    <<-- interrupt raised here that calls app_sched_event_put
    sd_app_evt_wait();
}

I am puzzled by this code for the idle loop, I do not understand how the system handles a situation where an interrupt is raised between the execution of app_shed_execute and sd_app_evt_wait. If the interrupt invokes a app_sched_event_put, then the system will still go to (deep) sleep mode and will not execute the event handler until the next loop which could come much later. Am I missing something in the architecture?

Thanks Louis

Parents
  • Hello Nikita,

    Thanks and sorry, I had missed the note.

    If I understand correctly the note, it means that this main loop code is safe from race conditions: the system monitored interrupt handlers that were invoked outside of the wfe background wait and it will not wait if this was the case. Is my understanding correct?

    Thanks

    Louis

Reply
  • Hello Nikita,

    Thanks and sorry, I had missed the note.

    If I understand correctly the note, it means that this main loop code is safe from race conditions: the system monitored interrupt handlers that were invoked outside of the wfe background wait and it will not wait if this was the case. Is my understanding correct?

    Thanks

    Louis

Children
No Data
Related