Hi,

I have a WinCE 5.0 system.
System can enter the sleep (suspend) mode, but when system can not wake up.
After I trace the codes, I found systems will hang up in sleep(10) of
SetVideoPowerState.
The same codes work in WinCE 4.2, but it failed in WinCE 5.0.
Why ?


void SetVideoPowerState(VIDEO_POWER_STATE PowerState)
{
//This is where the lcd would be turned on or off
g_ScreenState = PowerState;

if (g_ScreenState == VideoPowerOn)
{
.......Set some registers
Sleep(10);
.......Set some registers
}

.........
}

Re: Display driver in WinCE 5.0 by Dave

Dave
Mon Jan 31 11:26:16 CST 2005

On Mon, 31 Jan 2005 16:57:05 +0800, "Yu" <Yu.Mails@msa.hinet.net>
wrote:

>Hi,
>
>I have a WinCE 5.0 system.
>System can enter the sleep (suspend) mode, but when system can not wake up.
>After I trace the codes, I found systems will hang up in sleep(10) of
>SetVideoPowerState.
>The same codes work in WinCE 4.2, but it failed in WinCE 5.0.
>Why ?
>
>
>void SetVideoPowerState(VIDEO_POWER_STATE PowerState)
>{
> //This is where the lcd would be turned on or off
> g_ScreenState = PowerState;
>
> if (g_ScreenState == VideoPowerOn)
> {
> .......Set some registers
> Sleep(10);
> .......Set some registers
> }
>
> .........
>}
>

If I remember right, the power management routines are called during
interrupt context and you cannot make system calls, like Sleep(), from
there.



Dave Heil
Vytek Inc.

Re: Display driver in WinCE 5.0 by Yu

Yu
Mon Jan 31 21:04:24 CST 2005

Hi,

However, the codes works in WinCE 4.2.
If we can not use sleep(10) in SetVideoPowerState in WinCE 5.0, what method
can I use like sleep ?

Thanks.

Yu.



Re: Display driver in WinCE 5.0 by K

K
Mon Jan 31 22:13:42 CST 2005

You may use a H/W Counter and loop until 10ms.
or use a busy loop to loop some period.

"Yu" <Yu.Mails@msa.hinet.net> ¼¶¼g©ó¶l¥ó·s»D
:ub8T8qACFHA.2804@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> However, the codes works in WinCE 4.2.
> If we can not use sleep(10) in SetVideoPowerState in WinCE 5.0, what
method
> can I use like sleep ?
>
> Thanks.
>
> Yu.
>
>



Re: Display driver in WinCE 5.0 by Yu

Yu
Tue Feb 01 05:37:16 CST 2005

Is it true that we can not use sleep() in SetVideoPowerState in WinCE 5.0 ?

Thanks.

Yu.



Re: Display driver in WinCE 5.0 by Ronald

Ronald
Tue Feb 22 19:04:53 CST 2005

If your SetVideoPowerState() function is called as the result of a callback
from the power manager (IOCTL_POWER_xxxx) it is perfectly alright to use
Sleep(). If it is getting called from the context of a XXX_PowerDown/Up it
is not. See your online platform builder documentation.

"Yu" <Yu.Mails@msa.hinet.net> wrote in message
news:OX7fhJFCFHA.1408@TK2MSFTNGP10.phx.gbl...
> Is it true that we can not use sleep() in SetVideoPowerState in WinCE 5.0
> ?
>
> Thanks.
>
> Yu.
>
>