INTERRUPTS_ENABLE (Compact 2013)
This function enables or disables all interrupts and returns the current state.
INTERRUPTS_ENABLE is available to OEM adaptation layer (OAL) routines so that they can perform critical operations without being interrupted. The caller should use the return value to restore the interrupt state, as shown in the following code example:
fWasEnabled = INTERRUPTS_ENABLE (FALSE); // Disable interrupt. DoCriticalOperations (); INTERRUPTS_ENABLE (fWasEnabled); // restore interrupt state
When synchronizing real-time clock (RTC) routines, critical sections should be utilized instead of interrupts.