summaryrefslogtreecommitdiff
authorsandman <sandman>2002-10-19 01:12:25 (UTC)
committer sandman <sandman>2002-10-19 01:12:25 (UTC)
commita0ea0e7ff2fad769a92136edc1a7381692e7739f (patch) (unidiff)
tree8c186385c133ca4ad06de66b93a91131a52cc06e
parente869be9990c0db11288bd196778cadd0ad6976a9 (diff)
downloadopie-a0ea0e7ff2fad769a92136edc1a7381692e7739f.zip
opie-a0ea0e7ff2fad769a92136edc1a7381692e7739f.tar.gz
opie-a0ea0e7ff2fad769a92136edc1a7381692e7739f.tar.bz2
don't probe for old device names on iPAQs anymore
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 80e9a91..58bd663 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -567,35 +567,33 @@ void iPAQ::timerEvent ( QTimerEvent * )
567 killTimer ( m_power_timer ); 567 killTimer ( m_power_timer );
568 m_power_timer = 0; 568 m_power_timer = 0;
569 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false ); 569 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
570 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); 570 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
571} 571}
572 572
573 573
574void iPAQ::alarmSound ( ) 574void iPAQ::alarmSound ( )
575{ 575{
576#if defined( QT_QWS_IPAQ ) // IPAQ 576#if defined( QT_QWS_IPAQ ) // IPAQ
577#ifndef QT_NO_SOUND 577#ifndef QT_NO_SOUND
578 static Sound snd ( "alarm" ); 578 static Sound snd ( "alarm" );
579 int fd; 579 int fd;
580 int vol; 580 int vol;
581 bool vol_reset = false; 581 bool vol_reset = false;
582 582
583 if ((( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) || 583 if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) {
584 (( fd = ::open ( "/dev/mixer", O_RDWR )) >= 0 )) {
585
586 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { 584 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) {
587 Config cfg ( "qpe" ); 585 Config cfg ( "qpe" );
588 cfg. setGroup ( "Volume" ); 586 cfg. setGroup ( "Volume" );
589 587
590 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 588 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
591 if ( volalarm < 0 ) 589 if ( volalarm < 0 )
592 volalarm = 0; 590 volalarm = 0;
593 else if ( volalarm > 100 ) 591 else if ( volalarm > 100 )
594 volalarm = 100; 592 volalarm = 100;
595 volalarm |= ( volalarm << 8 ); 593 volalarm |= ( volalarm << 8 );
596 594
597 if (( volalarm & 0xff ) > ( vol & 0xff )) { 595 if (( volalarm & 0xff ) > ( vol & 0xff )) {
598 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) 596 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 )
599 vol_reset = true; 597 vol_reset = true;
600 } 598 }
601 } 599 }
@@ -638,34 +636,33 @@ bool iPAQ::setSoftSuspend ( bool soft )
638bool iPAQ::setDisplayBrightness ( int bright ) 636bool iPAQ::setDisplayBrightness ( int bright )
639{ 637{
640 bool res = false; 638 bool res = false;
641 int fd; 639 int fd;
642 640
643 if ( bright > 255 ) 641 if ( bright > 255 )
644 bright = 255; 642 bright = 255;
645 if ( bright < 0 ) 643 if ( bright < 0 )
646 bright = 0; 644 bright = 0;
647 645
648 // 128 is the maximum if you want a decent lifetime for the LCD 646 // 128 is the maximum if you want a decent lifetime for the LCD
649 647
650 if ( bright > 1 ) 648 if ( bright > 1 )
651 bright = (int) ( 0.5 + ( ::pow ( 2, double( bright ) / 255.0 ) - 1 ) * 128.0 ); // logarithmic 649 bright = (int) ( 0.5 + ( ::pow ( 2, double( bright ) / 255.0 ) - 1 ) * 128.0 ); // logarithmic
652 //bright = ( bright + 1 ) / 2; 650 //bright = ( bright + 1 ) / 2;
653 651
654 if ((( fd = ::open ( "/dev/ts", O_WRONLY )) >= 0 ) || 652 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
655 (( fd = ::open ( "/dev/h3600_ts", O_WRONLY )) >= 0 )) {
656 FLITE_IN bl; 653 FLITE_IN bl;
657 bl. mode = 1; 654 bl. mode = 1;
658 bl. pwr = bright ? 1 : 0; 655 bl. pwr = bright ? 1 : 0;
659 bl. brightness = bright; 656 bl. brightness = bright;
660 res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 ); 657 res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 );
661 ::close ( fd ); 658 ::close ( fd );
662 } 659 }
663 return res; 660 return res;
664} 661}
665 662
666int iPAQ::displayBrightnessResolution ( ) const 663int iPAQ::displayBrightnessResolution ( ) const
667{ 664{
668 return 255; // really 128, but logarithmic control is smoother this way 665 return 255; // really 128, but logarithmic control is smoother this way
669} 666}
670 667
671 668