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

Detect if code has been interrupted by Softdevice

Hi,

I there a way that I can detect if a sections of my code has been interrupted by the Softdevice? I have some time critical code (bit banging a communication protocol), and it's important for the timing, that it's not interrupted at certain points.

I want to check if an interrupted has occurred, and the possibly retry my operation.

Using CRITICAL_REGION_ENTER is not enough, as it only disables application interrupts, and not the ones used by the Softdevice. Is the safe to __disable_irq while the advertisement is active?

Another way of approaching my problem, is to make sure there is enough time before the next interrupt by the advertising service. Is there some way that I calculate the time till next interrupts, or possibly the time since last interrupt?

Best, Jacob

Related