INTERRUPTS_ENABLE (Compact 2013)
3/28/2014
This function enables or disables all interrupts and returns the current state.
BOOL INTERRUPTS_ENABLE(
BOOL fEnable
);
- fEnable
[in] Flag to turn on/off interrupts.
The previous interrupt enable/disable 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.
Header |
nkintr.h |
Library |
Nk.lib |