Here's a shot in the dark...

Are you able to call this driver's sleep and wake handler routines? If
it's implemented as a shared library, I would bet you can.

Hope this helps. 

-Dave

-----Original Message-----
From: Bob Whiteman [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 12:48 PM
To: Palm Developer Forum
Subject: Quick off & on

I've found a bug in a driver which can be avoided by powering the device
off. I'm trying to programmatically power the device off and then
immediately back on again.

My code successfully enqueues a keyDownEvent with chr = vchrAutoOff, and
the
device sleeps as expected. I also set an alarm for TimGetSeconds() + 1
so
the device will wake up one second later. The result is that the device
doesn't sleep. Apparently the alarm is triggered before the device
sleeps,
so it never fully goes to sleep.

To make sure the alarm is set as late as possible in the sleep process I
register for the sysNotifySleepNotifyEvent. I use a high priority value
of
240 so my program will receive the notification last. While handling the
sysNotifySleepNotifyEvent I set the alarm. The results are the same.

If instead I set the alarm for TimGetSeconds() + 2 the device always
sleeps
as expected, but it can take 6-10 seconds to wake up again, which is too
long for my application.

Can anyone suggest a reliable way to put the device to sleep and wake it
up
quickly?

    Thanks,
          -Bob Whiteman


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to