|
- 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);
- }
- }
复制代码
上面是三星的 IST 代码,我读不懂的是处理 小抖动 这块:
就是两个 PBT_IsPushed() 之间延时 200 毫秒这里,
麻烦兄弟们分析解释一下这里是咋回事!
|
|