19,520
社区成员




while (1)
{
WaitForSingleObject(gPwrButtonIntrEvent, INFINITE);
if (gOffFlag == FALSE)
{
if (PBT_IsPushed()) /* To Filter Noise */
{
Sleep(200);
if (PBT_IsPushed())
{
//RETAILMSG(1, (TEXT("::: Back Light On/Off \r\n")));
}
else
{
// Soft reset and standard suspend-resume both start with suspend for now.
#if (WINCEOSVER >= 400)
// call whichever shutdown API is available
if(gpfnSetSystemPowerState != NULL)
{
gpfnSetSystemPowerState(NULL, POWER_STATE_SUSPEND, POWER_FORCE);
}
else
{
PowerOffSystem();
}
#else
PowerOffSystem();
#endif
// Give control back to system if it wants it for anything. Not in
// power handling mode yet. All suspend and resume operations
// will be performed in the PowerOffSystem() function.
DriverSleep(0, FALSE);
}
}
InterruptDone(SYSINTR_POWER);
}
}