Using the nRF51822. I have a routine that should never be interrupted. What is the easiest way to disable all interrupts, and then re-enabling them?
Using the nRF51822. I have a routine that should never be interrupted. What is the easiest way to disable all interrupts, and then re-enabling them?
Hi Ole, What about register that changes on read, like the EVENT_READY flag for SPI ? I seem to be having problem with that, and the problem seems to go away if I use a timeout instead of just while(SPI->EVENT_READY == 0);
Yours, Felix
I have a similar requirement in my application and I would love more information regarding this.
I need to turn off all interrupts so that I can guarantee a timed sequence of events. This sequence will always finish in <10us. Is this a short enough time to have interrupts off for the soft device to not barf?
Is there some amount of time that I can turn off interrupts for less than and not interfere with the SD?
I'm also very curious to know more about "[...] using the radio notification feature to control when exactly you do this."
To put it another way, if I can regularly get a 10us window of disabled interrupts with maximum latency of ~10ms, I'd be very happy.
Hi, It looks like the new Timeslot API feature in S110 v7 alpha may be able to do what you want. With that feature, you can request timeslots where the SoftDevice's links is guaranteed to be idle, and you can for instance disable interrupts safely. It is possible to schedule such timeslots regularly at any interval, but there may be cases where the timeslot scheduled can be denied due to critical events in a connection, for example. This gets more likely the longer timeslots you request and the more often you request them, and also with shorter BLE connection intervals. So if your code can handle being denied to run once in a while, this should be suitable for you. If your code does not have as strict timing requirements and allow some variations in the interval, you could do even better, by requesting timeslots in a more clever way, based on your needs.
See the S110 SoftDevice Specification and API-documentation for more details.