- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can anyone tell me the execution context of the callback function passed to Cy_BLE_Start()? Is it the same execution context as Cy_BLE_ProcessEvents() or is it executing in an interrupt?
I debugged to the first line in the callback function and it shows a continuous call stack through Cy_BLE_ProcessEvents() right up to main() but I'm not 100% sure that it's accurate evidence of the same execution context.
I need to know because of my application will access data blocks in the callback function and the main loop so I need to protect the data block integrity if the execution contexts are different.
Thanks - JJS
Solved! Go to Solution.
- Labels:
-
PSoC 6 MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The function passed to Cy_BLE_Start() will get executed only when the Cy_BLE_ProcessEvents() function is called. It will not execute on BLE interrupt.
The BLE interrupts are handled by the core automatically and the data will be stored in the buffers. Only when the user calls the Cy_BLE_ProcessEvents(), the function passed to Cy_BLE_Start() will be executed. so instead of calling it as a callback function, it is better to call it as Event Handler.
Hope this information helps!
Thanks and regards
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The function passed to Cy_BLE_Start() will get executed only when the Cy_BLE_ProcessEvents() function is called. It will not execute on BLE interrupt.
The BLE interrupts are handled by the core automatically and the data will be stored in the buffers. Only when the user calls the Cy_BLE_ProcessEvents(), the function passed to Cy_BLE_Start() will be executed. so instead of calling it as a callback function, it is better to call it as Event Handler.
Hope this information helps!
Thanks and regards
Ganesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, Ganesh for the confirmation. It was helpful. - JJS