summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 160568b..f808960 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -553,30 +553,34 @@ bool ODevice::setDisplayStatus ( bool on )
}
return res;
}
/**
* This sets the display brightness
+ *
+ * @param p The brightness to be set on a scale from 0 to 255
* @return success or failure
*/
bool ODevice::setDisplayBrightness ( int p)
{
Q_UNUSED( p )
return false;
}
/**
- * @return return the max value for the brightness settings slider
+ * @return returns the number of steppings on the brightness slider
+ * in the Light-'n-Power settings.
*/
int ODevice::displayBrightnessResolution ( ) const
{
return 16;
}
/**
* This sets the display contrast
+ * @param p The contrast to be set on a scale from 0 to 255
* @return success or failure
*/
bool ODevice::setDisplayContrast ( int p)
{
Q_UNUSED( p )
return false;
@@ -2067,19 +2071,19 @@ int Ramses::displayBrightnessResolution() const
bool Ramses::setDisplayContrast(int contr)
{
qDebug("Ramses::setDisplayContrast(%d)", contr);
bool res = false;
int fd;
- // pwm0 contrast: 35 steps 65..100 (dunkel->hell)
+ // pwm0 contrast: 20 steps 79..90 (dunkel->hell)
if (contr > 255 )
contr = 255;
if (contr < 0)
contr = 0;
- contr = 65 + (contr * 350 / 255);
+ contr = 90 - (contr * 20 / 255);
if ((fd = ::open("/proc/sys/board/pwm0", O_WRONLY)) >= 0) {
qDebug(" %d -> pwm0", contr);
char writeCommand[100];
const int count = sprintf(writeCommand, "%d\n", contr);
res = (::write(fd, writeCommand, count) != -1);
@@ -2091,8 +2095,8 @@ bool Ramses::setDisplayContrast(int contr)
return res;
}
int Ramses::displayContrastResolution() const
{
- return 32;
+ return 20;
}