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

nRF51822 S110 Re-entrancy Question

When a callback function is registered via the softdevice_ble_evt_handler_set(), are there re-entrancy issues when the callback is called by the softdevice?

For instance, in the S110 example code the following is indicated about the callback: "Function for dispatching a S110 SoftDevice event to all modules with a S110. This function is called from the S110 SoftDevice event interrupt handler after an event has been received."

This would seem to indicate that the callback could be an asynchronous call from an interrupt and there could be re-entrancy or other issues that could corrupt data structures if protections aren't put in place. If this is a danger, what mechanisms are provided by the nRF library to synchronize the callback so that it doesn't occur at a dangerous time such as when sensitive data structures being manipulated by the main code?

Thanks,

Mike

Related