author | mickeyl <mickeyl> | 2003-12-30 02:17:25 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-30 02:17:25 (UTC) |
commit | b53d9bc11a1e35e52f2fda4586ba8a53f8e0b48a (patch) (side-by-side diff) | |
tree | 98db0a0053c53e98ba758773f80ad8e14c9564c9 /libopie | |
parent | b636d3d91e8456b22bc450b3d7f3a862b7f615a9 (diff) | |
download | opie-b53d9bc11a1e35e52f2fda4586ba8a53f8e0b48a.zip opie-b53d9bc11a1e35e52f2fda4586ba8a53f8e0b48a.tar.gz opie-b53d9bc11a1e35e52f2fda4586ba8a53f8e0b48a.tar.bz2 |
fix a problem in the c7x0 backlight handling...
Bah! Got confused by the input interval for ODevice::setDisplayBrightness()
(once) again - it has been ridiculous to scale that down from [0-255] to the actual
interval since the day we invented ODevice::displayBrightnessResolution().
I'm going to remove that antique cruft soon.
-rw-r--r-- | libopie/odevice.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index bc09e92..82a0099 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -1964,6 +1964,7 @@ bool Zaurus::setSoftSuspend ( bool soft ) bool Zaurus::setDisplayBrightness ( int bright ) { + //qDebug( "Zaurus::setDisplayBrightness( %d )", bright ); bool res = false; int fd; @@ -1974,12 +1975,13 @@ bool Zaurus::setDisplayBrightness ( int bright ) { if ( d->m_model == Model_Zaurus_SLC7x0 ) { + //qDebug( "using special treatment for devices with the corgi backlight interface" ); // special treatment for devices with the corgi backlight interface if (( fd = ::open ( "/proc/driver/fl/corgi-bl", O_WRONLY )) >= 0 ) { - if ( bright > 0x11 ) bright = 0x11; + int value = ( bright == 1 ) ? 1 : bright * ( 17.0 / 255.0 ); char writeCommand[100]; - const int count = sprintf( writeCommand, "0x%x\n", bright ); + const int count = sprintf( writeCommand, "0x%x\n", value ); res = ( ::write ( fd, writeCommand, count ) != -1 ); ::close ( fd ); } |