summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-01-19 22:56:37 +0000
committerThomas Martitz <kugel@rockbox.org>2010-01-19 22:56:37 +0000
commitb5e1a1cc59fbba215b5e6c4f493800405787cd99 (patch)
tree31e89bafc1d4ea75ad2fd4778c4aee51d209fb15
parent93bba4700155b21b9f0ef4fcf043db1f6bc41e25 (diff)
downloadrockbox-b5e1a1cc59fbba215b5e6c4f493800405787cd99.tar.gz
rockbox-b5e1a1cc59fbba215b5e6c4f493800405787cd99.tar.bz2
rockbox-b5e1a1cc59fbba215b5e6c4f493800405787cd99.zip
Fix red, moved around a bit to much.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24291 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/common/backlight-sim.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/uisimulator/common/backlight-sim.c b/uisimulator/common/backlight-sim.c
index aa8fe8e844..f5da77a782 100644
--- a/uisimulator/common/backlight-sim.c
+++ b/uisimulator/common/backlight-sim.c
@@ -30,17 +30,28 @@ extern void lcd_awake(void);
/* in uisimulator/sdl/lcd-bitmap.c and lcd-charcell.c */
extern void sim_backlight(int value);
+bool _backlight_init(void)
+{
+ return true;
+}
+
+
+#ifdef HAVE_BACKLIGHT_BRIGHTNESS
+
static inline int normalize_backlight(int val)
{
/* normalize to xx% brightness for sdl */
return ((val - MIN_BRIGHTNESS_SETTING + 1) * 100)/MAX_BRIGHTNESS_SETTING;
}
-bool _backlight_init(void)
+void _backlight_set_brightness(int val)
{
- return true;
+ sim_backlight(normalize_backlight(val));
}
+#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
+
+
void _backlight_on(void)
{
#if defined(HAVE_LCD_ENABLE)
@@ -51,7 +62,12 @@ void _backlight_on(void)
#if (CONFIG_BACKLIGHT_FADING != BACKLIGHT_FADING_SW_SETTING)
/* if we set the brightness to the settings value, then fading up
* is glitchy */
+#ifdef HAVE_BACKLIGHT_BRIGHTNESS
sim_backlight(normalize_backlight(backlight_brightness));
+#else
+ sim_backlight(100);
+#endif
+
#endif
}
@@ -63,12 +79,7 @@ void _backlight_off(void)
#endif
}
-#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-void _backlight_set_brightness(int val)
-{
- sim_backlight(normalize_backlight(val));
-}
-#endif /* HAVE_BACKLIGHT_BRIGHTNESS */
+
#ifdef HAVE_BUTTON_LIGHT
void _buttonlight_on(void)
{