This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

sd_ble_evt_get called from main context

Hi all

In the documentation for the function "sd_ble_evt_get" it is mentioned, that this function may be called directly in the ISR for the SD_EVT_IRQn or from the main context.

I personally would prefere to call it from the main context, because the handling of events would be much easier this way. The change into the main context may take some time (depends on the activities in the system).

How long may the call to sd_ble_evt_get be delayed? What is the influence of this delayed call to sd_ble_evt_get? Are there any performance (throughput) issues to be considered?

BR Adrian

  • It is perfectly legal to postpone the event getting and do it from main context. This is in fact what will happen if you use the app_scheduler SDK module. You may have use in looking at this question.

    The maximum blocking times of the softdevice are detailed in the softdevice specification, and the blocking time experienced for main will be the same as the one experienced for the priority level of SD_EVT_IRQn. I wouldn't expect this to have any effect on throughput, unless you have some very long-lasting application interrupts (i.e. running for just little less than the connection interval), but this isn't something I've tested in detail.

Related