diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
commit | b51f7dfc9b507ab9db12fe90b2ddad708f435e06 (patch) | |
tree | efcef3411689401da21795d700a0741f8ab1072b /apps/settings_menu.c | |
parent | e68680ac310adb8373c9f3a5194466766d64cf37 (diff) | |
download | rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.gz rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.zip |
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.c | 31 |
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) | |||
137 | #ifdef CONFIG_BACKLIGHT | 137 | #ifdef CONFIG_BACKLIGHT |
138 | static bool caption_backlight(void) | 138 | static bool caption_backlight(void) |
139 | { | 139 | { |
140 | bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT), | 140 | return set_bool( str(LANG_CAPTION_BACKLIGHT), |
141 | &global_settings.caption_backlight); | 141 | &global_settings.caption_backlight); |
142 | |||
143 | return rc; | ||
144 | } | 142 | } |
145 | 143 | ||
146 | #ifdef HAVE_CHARGING | 144 | #ifdef HAVE_CHARGING |
@@ -180,7 +178,7 @@ static bool backlight_timer(void) | |||
180 | INT, names, 19, backlight_set_timeout ); | 178 | INT, names, 19, backlight_set_timeout ); |
181 | } | 179 | } |
182 | 180 | ||
183 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 | 181 | #if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR) |
184 | static bool backlight_fade_in(void) | 182 | static bool backlight_fade_in(void) |
185 | { | 183 | { |
186 | static const struct opt_items names[] = { | 184 | static const struct opt_items names[] = { |
@@ -242,6 +240,22 @@ static bool remote_backlight_timer(void) | |||
242 | INT, names, 19, remote_backlight_set_timeout ); | 240 | INT, names, 19, remote_backlight_set_timeout ); |
243 | } | 241 | } |
244 | 242 | ||
243 | #ifdef HAVE_CHARGING | ||
244 | static bool remote_backlight_on_when_charging(void) | ||
245 | { | ||
246 | bool result = set_bool(str(LANG_BACKLIGHT_ON_WHEN_CHARGING), | ||
247 | &global_settings.remote_backlight_on_when_charging); | ||
248 | remote_backlight_set_on_when_charging( | ||
249 | global_settings.remote_backlight_on_when_charging); | ||
250 | return result; | ||
251 | } | ||
252 | #endif | ||
253 | |||
254 | static bool remote_caption_backlight(void) | ||
255 | { | ||
256 | return set_bool( str(LANG_CAPTION_BACKLIGHT), | ||
257 | &global_settings.remote_caption_backlight); | ||
258 | } | ||
245 | #endif /* HAVE_REMOTE_LCD */ | 259 | #endif /* HAVE_REMOTE_LCD */ |
246 | 260 | ||
247 | static bool contrast(void) | 261 | static bool contrast(void) |
@@ -1521,7 +1535,7 @@ static bool lcd_settings_menu(void) | |||
1521 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, | 1535 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, |
1522 | #endif | 1536 | #endif |
1523 | { ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight }, | 1537 | { ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight }, |
1524 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 | 1538 | #if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR) |
1525 | { ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in }, | 1539 | { ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in }, |
1526 | { ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out }, | 1540 | { ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out }, |
1527 | #endif | 1541 | #endif |
@@ -1549,6 +1563,11 @@ static bool lcd_remote_settings_menu(void) | |||
1549 | 1563 | ||
1550 | static const struct menu_item items[] = { | 1564 | static const struct menu_item items[] = { |
1551 | { ID2P(LANG_BACKLIGHT), remote_backlight_timer }, | 1565 | { ID2P(LANG_BACKLIGHT), remote_backlight_timer }, |
1566 | #ifdef HAVE_CHARGING | ||
1567 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), | ||
1568 | remote_backlight_on_when_charging }, | ||
1569 | #endif | ||
1570 | { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight }, | ||
1552 | { ID2P(LANG_CONTRAST), remote_contrast }, | 1571 | { ID2P(LANG_CONTRAST), remote_contrast }, |
1553 | { ID2P(LANG_INVERT), remote_invert }, | 1572 | { ID2P(LANG_INVERT), remote_invert }, |
1554 | { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, | 1573 | { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, |