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?
Would it be fair to say that whenever the BLE stack is enabled, it is impossible to run any kind of tiny OS for the application? It would appear that way, since most if not all OS require the use of critical sections (i.e. __disable_irq).
No, I don't think that's a correct assumption, since you should be able to use the critical regions to protect such code. As far as I've seen, RTOSes disable IRQs to protect against their own interrupts interfering with the data structures. However, in the case of the softdevice, it doesn't change any state or data in the application space, and as such, it shouldn't cause any problems for the RTOS if such an interrupt occurs, even when in a critical region.
You may also have interest in taking a look at this: https://devzone.nordicsemi.com/index.php/freertos
No, I don't think that's a correct assumption, since you should be able to use the critical regions to protect such code. As far as I've seen, RTOSes disable IRQs to protect against their own interrupts interfering with the data structures. However, in the case of the softdevice, it doesn't change any state or data in the application space, and as such, it shouldn't cause any problems for the RTOS if such an interrupt occurs, even when in a critical region.
You may also have interest in taking a look at this: https://devzone.nordicsemi.com/index.php/freertos