Question
STM32F4xx __disable_irq(void)
Posted on July 01, 2013 at 15:36
Writing in 'C', I use __disable_irq(void) before reading a value that gets updated in an interrupt service routine.
__disable_irq(); //prevent serial interrupts
Count = TSp->DataAvailable; //get number of entries
TSp->DataAvailable = 0; //and clear structure member count
__enable_irq(); //allow serial interrupts
Is it
guaranteed
that when the instructions for ''Count = TSp->DataAvailable;'' execute, interrupts are disabled or do I need an explicit synchronisation barrier (ISB for example)? If so, do I need a barrier before enabling interrupts again? The compiler is Keil ARM if that makes any difference.