INTERRUPTS_ENABLE (Windows Embedded CE 6.0)

1/6/2010

This function enables or disables all interrupts and returns the current state.

Syntax

BOOL INTERRUPTS_ENABLE(
  BOOL fEnable
);

Parameters

  • fEnable
    [in] Flag to turn on/off interrupts.

Return Value

The previous interrupt enable/disable state.

Remarks

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. More information on using critical sections, see Critical Section Objects.

Requirements

Header nkintr.h
Library Nk.lib
Windows Embedded CE Windows CE .NET 4.0 and later

See Also

Reference

Kernel Functions
INTERRUPTS_OFF
INTERRUPTS_ON