2012-03-14 03:48 PM
Hello
I want to disable interrupt while I am putting data to buffer, but I dont want to loss any interrupts during this time - I want them to be autimatically trigged when enable interrupts back. I have found in CMSIS __enable_irq(); and __disable_irq(); static __INLINE void __enable_irq() { __ASM volatile (''cpsie i''); } static __INLINE void __disable_irq() { __ASM volatile (''cpsid i''); } is it works as I want it to work ? Is interrupts that came in period between disable and enable will not be lost? with best regards2012-03-15 09:00 AM
if everything else is as it should be, disabling an interrupt will work as you want.
it is a common misconception that e.g. the UART generates an interrupt, it does not, it sets a bit that the interrupt processor, when the interrupt ios enabled will check. so, the UART set a bit The interrupt processor generates the interrupt. the problem with disabling interrupts is that there is no ''counter'' so, if e.g. during interrupt disabled the UART receives two characters, you will only get ONE interrupt OOPS. thus disabling interrupts should be done VERY prudently.I am putting data to buffer sounds like something that may take too long Erik