summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-06-27 19:10:42 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-06-27 19:10:42 +0000
commit660daa51d43b87de475023bd9ec84933169cfe7e (patch)
treecc578d9870bfe31cd8fa638ddcb4d0fda536189c /firmware/target
parent13d0b526c378e62f84d1950b4fe7b856e47b37f8 (diff)
downloadrockbox-660daa51d43b87de475023bd9ec84933169cfe7e.tar.gz
rockbox-660daa51d43b87de475023bd9ec84933169cfe7e.zip
Meizu M3: implement logarithmic brightness curve (curve provided by markun) and increase PWM frequency for the backlight.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21532 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/s5l8700/backlight-meizu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/firmware/target/arm/s5l8700/backlight-meizu.c b/firmware/target/arm/s5l8700/backlight-meizu.c
index 43cbb16a2d..23dcbb1820 100644
--- a/firmware/target/arm/s5l8700/backlight-meizu.c
+++ b/firmware/target/arm/s5l8700/backlight-meizu.c
@@ -58,6 +58,8 @@ void INT_TIMERA(void)
void _backlight_set_brightness(int brightness)
{
+ static const unsigned char logtable[] = {0, 1, 2, 3, 5, 7, 10, 15, 22, 31, 44, 63, 90, 127, 180, 255};
+
if (brightness == MIN_BRIGHTNESS_SETTING) {
/* turn backlight fully off and disable interrupt */
PDAT0 &= ~(1 << 2);
@@ -70,7 +72,7 @@ void _backlight_set_brightness(int brightness)
}
else {
/* set PWM width and enable interrupt */
- TADATA0 = brightness;
+ TADATA0 = logtable[brightness];
INTMSK |= (1 << 5);
}
}
@@ -101,8 +103,8 @@ bool _backlight_init(void)
(1 << 11) | /* TA_START */
(3 << 8) | /* TA_CS = PCLK / 64 */
(1 << 4); /* TA_MODE_SEL = PWM mode */
- TADATA1 = MAX_BRIGHTNESS_SETTING; /* set PWM period */
- TAPRE = 100; /* prescaler */
+ TADATA1 = 255; /* set PWM period */
+ TAPRE = 30; /* prescaler */
_backlight_on();