summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2005-01-01 19:59:53 (UTC)
committer mickeyl <mickeyl>2005-01-01 19:59:53 (UTC)
commitd4b1226ed820ec06ba07361f31dbb35ce559a4cc (patch) (unidiff)
treed86de5da06a19d5d2a9efd8f1cbc5c90657b0406
parent5f310dcd91f574c1b34ca99c157c0b93e6ae1e16 (diff)
downloadopie-d4b1226ed820ec06ba07361f31dbb35ce559a4cc.zip
opie-d4b1226ed820ec06ba07361f31dbb35ce559a4cc.tar.gz
opie-d4b1226ed820ec06ba07361f31dbb35ce559a4cc.tar.bz2
slightly more correct way to calculate the brightness
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index e75e777..fb23e1d 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -409,25 +409,25 @@ bool Zaurus::setDisplayBrightness( int bright )
409 //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); 409 //qDebug( "Zaurus::setDisplayBrightness( %d )", bright );
410 bool res = false; 410 bool res = false;
411 411
412 if ( bright > 255 ) bright = 255; 412 if ( bright > 255 ) bright = 255;
413 if ( bright < 0 ) bright = 0; 413 if ( bright < 0 ) bright = 0;
414 414
415 if ( m_embedix ) 415 if ( m_embedix )
416 { 416 {
417 int numberOfSteps = displayBrightnessResolution(); 417 int numberOfSteps = displayBrightnessResolution();
418 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK ); 418 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_WRONLY|O_NONBLOCK );
419 if ( fd ) 419 if ( fd )
420 { 420 {
421 int val = ( numberOfSteps * 255 ) / 255; 421 int val = ( bright * numberOfSteps ) / 255;
422 res = ( ::ioctl ( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 ); 422 res = ( ::ioctl ( fd, SHARP_FL_IOCTL_STEP_CONTRAST, val ) == 0 );
423 ::close ( fd ); 423 ::close ( fd );
424 } 424 }
425 } 425 }
426 else 426 else
427 { 427 {
428 qDebug( "ODevice handling for non-embedix kernels not yet implemented" ); 428 qDebug( "ODevice handling for non-embedix kernels not yet implemented" );
429 } 429 }
430 return res; 430 return res;
431} 431}
432 432
433bool Zaurus::setDisplayStatus( bool on ) 433bool Zaurus::setDisplayStatus( bool on )