Share via


CPUEnterIdle Routine (Windows Embedded CE 6.0)

1/5/2010

CPUEnterIdle enables interrupts and puts the CPU, or the hardware platform, into a low-power state. When an interrupt occurs it will awaken the system. CPUEnterIdle is invoked with the same dwIdleParam parameter as OEMIdle.

This routine is prototyped as the following code example indicates.

void CPUEnterIdle(DWORD dwIdleParam);

If your hardware platform does not support low-power modes, the implementation can be used as shown in the following code example.

void CPUEnterIdle(DWORD dwIdleParam)
{
  fInterruptFlag = FALSE;
  INTERRUPTS_ON();
  while (!fInterruptFlag) {
  // Just wait here. Any interrupt will bump us out.
  }
}

Note

This requires that all interrupt service routines (ISRs) set the variable fInterruptFlag, which must be declared as volatile.

See Also

Concepts

Boilerplate Interface Routines

Other Resources

INTERRUPTS_ON