summaryrefslogtreecommitdiff
path: root/apps/settings_menu.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-21 23:55:39 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-21 23:55:39 +0000
commitb51f7dfc9b507ab9db12fe90b2ddad708f435e06 (patch)
treeefcef3411689401da21795d700a0741f8ab1072b /apps/settings_menu.c
parente68680ac310adb8373c9f3a5194466766d64cf37 (diff)
Backlight handling: * Added 'Caption Backlight' and 'Backlight On When Charging' for the iriver remote LCD. * Enabled the backlight code for the simulator, and prepared backlight simulation. It's only a stub atm, writing messages to the console window. * Added tick task handling to the simulators for this to work. * Code cleanup in backlight.c, less dead code.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8034 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r--apps/settings_menu.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index fc54436afb..5230dd2010 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -137,10 +137,8 @@ static bool remote_reduce_ticking(void)
#ifdef CONFIG_BACKLIGHT
static bool caption_backlight(void)
{
- bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT),
- &global_settings.caption_backlight);
-
- return rc;
+ return set_bool( str(LANG_CAPTION_BACKLIGHT),
+ &global_settings.caption_backlight);
}
#ifdef HAVE_CHARGING
@@ -180,7 +178,7 @@ static bool backlight_timer(void)
INT, names, 19, backlight_set_timeout );
}
-#if CONFIG_BACKLIGHT == BL_IRIVER_H100
+#if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR)
static bool backlight_fade_in(void)
{
static const struct opt_items names[] = {
@@ -242,6 +240,22 @@ static bool remote_backlight_timer(void)
INT, names, 19, remote_backlight_set_timeout );
}
+#ifdef HAVE_CHARGING
+static bool remote_backlight_on_when_charging(void)
+{
+ bool result = set_bool(str(LANG_BACKLIGHT_ON_WHEN_CHARGING),
+ &global_settings.remote_backlight_on_when_charging);
+ remote_backlight_set_on_when_charging(
+ global_settings.remote_backlight_on_when_charging);
+ return result;
+}
+#endif
+
+static bool remote_caption_backlight(void)
+{
+ return set_bool( str(LANG_CAPTION_BACKLIGHT),
+ &global_settings.remote_caption_backlight);
+}
#endif /* HAVE_REMOTE_LCD */
static bool contrast(void)
@@ -1521,7 +1535,7 @@ static bool lcd_settings_menu(void)
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging },
#endif
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
-#if CONFIG_BACKLIGHT == BL_IRIVER_H100
+#if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR)
{ ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in },
{ ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out },
#endif
@@ -1549,6 +1563,11 @@ static bool lcd_remote_settings_menu(void)
static const struct menu_item items[] = {
{ ID2P(LANG_BACKLIGHT), remote_backlight_timer },
+#ifdef HAVE_CHARGING
+ { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING),
+ remote_backlight_on_when_charging },
+#endif
+ { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight },
{ ID2P(LANG_CONTRAST), remote_contrast },
{ ID2P(LANG_INVERT), remote_invert },
{ ID2P(LANG_FLIP_DISPLAY), remote_flip_display },