Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Scheduler library examples

Hi,

I'm discovering documetation of the Scheduler library. So, as I understand the idea is to call function app_sched_event_put(...,some_func) from the interrupt/event handler and then passed some_func will be executed from the main. app_sched_execute()  should be added to main loop. Everything is clear. There are also some examples: HID Mouse Application and HID Keyboard Application. But in this examples I don't see in main.c any calling of the app_sched_event_put() function. It seems that main application doesn't use the Scheduler, only internal SDK components such as app_timer use it. 
Is it mistake or I don't understand something?

Parents Reply
  • Also, one more question regarding Scheduler. If I set NRF_SDH_DISPATCH_MODEL  1, so is it correct that all BLE events will be passed to main context? If yes, what will be with data the pointer to which passed to the sheduled handlers? For example if I have BLE_GATTS_EVT_WRITE event I want to handle written data, thus I need a pointer to this data. In case if I receive normal interrupts, then I receive the pointer to the data, which are valid only while interrupt is handling. But if I receive this interrupt in the main context, what will be with this data? Where they will be stored and how long?

Children
Related