author | sandman <sandman> | 2002-08-06 21:46:30 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-08-06 21:46:30 (UTC) |
commit | 2ac1e6ec5a97d3721a3d6513ea68e4e21da1d40b (patch) (unidiff) | |
tree | ad84f4e405da51a6ca14ab4dd33bfd7c9f2a411e /libopie | |
parent | 8084d002de5e310491eec7fac0713ef29d0cf30f (diff) | |
download | opie-2ac1e6ec5a97d3721a3d6513ea68e4e21da1d40b.zip opie-2ac1e6ec5a97d3721a3d6513ea68e4e21da1d40b.tar.gz opie-2ac1e6ec5a97d3721a3d6513ea68e4e21da1d40b.tar.bz2 |
- Fix for the "iPAQ won't suspend until apm --suspend is called" problem
- Improved the resume delay until the LCD backlight is on again
-rw-r--r-- | libopie/odevice.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 057c344..bf64676 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -301,17 +301,18 @@ void ODeviceIPAQ::tstp_sighandler ( int ) | |||
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | bool ODeviceIPAQ::suspend ( ) | 304 | bool ODeviceIPAQ::suspend ( ) |
305 | { | 305 | { |
306 | int fd; | 306 | int fd; |
307 | bool res = false; | 307 | bool res = false; |
308 | 308 | ||
309 | if (( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) { | 309 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || |
310 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { | ||
310 | struct timeval tvs, tvn; | 311 | struct timeval tvs, tvn; |
311 | 312 | ||
312 | ::signal ( SIGTSTP, tstp_sighandler ); | 313 | ::signal ( SIGTSTP, tstp_sighandler ); |
313 | ::gettimeofday ( &tvs, 0 ); | 314 | ::gettimeofday ( &tvs, 0 ); |
314 | 315 | ||
315 | res = ( ::ioctl ( fd, APM_IOC_SUSPEND ) == 0 ); | 316 | res = ( ::ioctl ( fd, APM_IOC_SUSPEND ) == 0 ); |
316 | ::close ( fd ); | 317 | ::close ( fd ); |
317 | 318 | ||
@@ -323,16 +324,17 @@ bool ODeviceIPAQ::suspend ( ) | |||
323 | ::gettimeofday ( &tvn, 0 ); | 324 | ::gettimeofday ( &tvn, 0 ); |
324 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); | 325 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); |
325 | 326 | ||
326 | ::kill ( -::getpid ( ), SIGCONT ); | 327 | ::kill ( -::getpid ( ), SIGCONT ); |
327 | } | 328 | } |
328 | 329 | ||
329 | ::signal ( SIGTSTP, SIG_DFL ); | 330 | ::signal ( SIGTSTP, SIG_DFL ); |
330 | } | 331 | } |
332 | |||
331 | return res; | 333 | return res; |
332 | } | 334 | } |
333 | 335 | ||
334 | 336 | ||
335 | void ODeviceIPAQ::alarmSound ( ) | 337 | void ODeviceIPAQ::alarmSound ( ) |
336 | { | 338 | { |
337 | #if defined( QT_QWS_IPAQ ) // IPAQ | 339 | #if defined( QT_QWS_IPAQ ) // IPAQ |
338 | #ifndef QT_NO_SOUND | 340 | #ifndef QT_NO_SOUND |