summaryrefslogtreecommitdiffstats
path: root/uisimulator/common
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-12-17 13:44:09 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-12-17 13:44:09 +0000
commit5d96c3ba711f0a1b3fd71cad0764b56f0260df8d (patch)
tree5ac0950baac6ca901ebd582611a41772042e6151 /uisimulator/common
parent6c683d449ea2b9955f827e898e1fd527fd814d20 (diff)
downloadrockbox-5d96c3ba711f0a1b3fd71cad0764b56f0260df8d.tar.gz
rockbox-5d96c3ba711f0a1b3fd71cad0764b56f0260df8d.tar.bz2
rockbox-5d96c3ba711f0a1b3fd71cad0764b56f0260df8d.zip
Enable backlight brightness in simulator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24042 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/common')
-rw-r--r--uisimulator/common/backlight-sim.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/uisimulator/common/backlight-sim.c b/uisimulator/common/backlight-sim.c
index e8bce8ff7a..74a715a035 100644
--- a/uisimulator/common/backlight-sim.c
+++ b/uisimulator/common/backlight-sim.c
@@ -30,6 +30,8 @@ extern void lcd_awake(void);
/* in uisimulator/sdl/lcd-bitmap.c and lcd-charcell.c */
extern void sim_backlight(int value);
+static int old_val = 100;
+
bool _backlight_init(void)
{
return true;
@@ -37,7 +39,7 @@ bool _backlight_init(void)
void _backlight_on(void)
{
- sim_backlight(100);
+ sim_backlight(old_val);
#if defined(HAVE_LCD_ENABLE)
lcd_enable(true);
#elif defined(HAVE_LCD_SLEEP)
@@ -56,7 +58,10 @@ void _backlight_off(void)
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
void _backlight_set_brightness(int val)
{
- (void)val;
+ int normalized = ((val - MIN_BRIGHTNESS_SETTING + 1) * 100) / MAX_BRIGHTNESS_SETTING;
+ sim_backlight(normalized);
+
+ old_val = normalized;
}
#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
#ifdef HAVE_BUTTON_LIGHT