AnsweredAssumed Answered

STM32F4xx __disable_irq(void)

Question asked by John F. on Jul 1, 2013
Latest reply on Jul 2, 2013 by John F.
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.