From 7477c09b42a02484dadbe8da700e8c18e29ffef2 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Mon, 30 May 2005 00:00:22 +0000 Subject: Remote LCD: added own backlight timeout stuff git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6533 a1c6a512-1295-4272-9138-f99709370657 --- apps/screens.c | 1 + apps/settings.c | 11 +++++++---- apps/settings_menu.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/screens.c b/apps/screens.c index 3c53b4e..02a4bc3 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -343,6 +343,7 @@ int charging_screen(void) lcd_clear_display(); backlight_set_timeout(global_settings.backlight_timeout); + remote_backlight_set_timeout(global_settings.remote_backlight_timeout); backlight_set_on_when_charging(global_settings.backlight_on_when_charging); status_draw(true); diff --git a/apps/settings.c b/apps/settings.c index 0780cf2..4f09f93 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -253,8 +253,10 @@ static const struct bit_entry rtc_bits[] = #ifdef HAVE_REMOTE_LCD /* remote lcd */ - {6, S_O(remote_contrast), 42, "remote_contrast", NULL }, - {1, S_O(remote_invert), false, "remote_invert", off_on }, + {6, S_O(remote_contrast), 42, "remote contrast", NULL }, + {1, S_O(remote_invert), false, "remote invert", off_on }, + {5, S_O(remote_backlight_timeout), 5, "remote backlight timeout", + "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90" }, #endif /* Current sum of bits: 259 (worst case) */ @@ -744,8 +746,9 @@ void settings_apply(void) lcd_set_contrast(global_settings.contrast); lcd_scroll_speed(global_settings.scroll_speed); #ifdef HAVE_REMOTE_LCD - lcd_remote_set_contrast(global_settings.remote_contrast); - lcd_remote_set_invert_display(global_settings.remote_invert); + lcd_remote_set_contrast(global_settings.remote_contrast); + lcd_remote_set_invert_display(global_settings.remote_invert); + remote_backlight_set_timeout(global_settings.remote_backlight_timeout); #endif backlight_set_timeout(global_settings.backlight_timeout); backlight_set_on_when_charging(global_settings.backlight_on_when_charging); diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 4323cd2..f1ef076 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -637,6 +637,37 @@ static bool backlight_timer(void) } #endif /* CONFIG_BACKLIGHT */ +#ifdef HAVE_REMOTE_LCD + +static bool remote_backlight_timer(void) +{ + static const struct opt_items names[] = { + { STR(LANG_OFF) }, + { STR(LANG_ON) }, + { "1s ", TALK_ID(1, UNIT_SEC) }, + { "2s ", TALK_ID(2, UNIT_SEC) }, + { "3s ", TALK_ID(3, UNIT_SEC) }, + { "4s ", TALK_ID(4, UNIT_SEC) }, + { "5s ", TALK_ID(5, UNIT_SEC) }, + { "6s ", TALK_ID(6, UNIT_SEC) }, + { "7s ", TALK_ID(7, UNIT_SEC) }, + { "8s ", TALK_ID(8, UNIT_SEC) }, + { "9s ", TALK_ID(9, UNIT_SEC) }, + { "10s", TALK_ID(10, UNIT_SEC) }, + { "15s", TALK_ID(15, UNIT_SEC) }, + { "20s", TALK_ID(20, UNIT_SEC) }, + { "25s", TALK_ID(25, UNIT_SEC) }, + { "30s", TALK_ID(30, UNIT_SEC) }, + { "45s", TALK_ID(45, UNIT_SEC) }, + { "60s", TALK_ID(60, UNIT_SEC) }, + { "90s", TALK_ID(90, UNIT_SEC) } + }; + return set_option(str(LANG_BACKLIGHT), &global_settings.remote_backlight_timeout, + INT, names, 19, backlight_set_timeout ); +} + +#endif /* HAVE_REMOTE_LCD */ + static bool poweroff_idle_timer(void) { static const struct opt_items names[] = { @@ -1210,6 +1241,7 @@ static bool lcd_remote_settings_menu(void) bool result; static const struct menu_item items[] = { + { ID2P(LANG_BACKLIGHT), remote_backlight_timer }, { ID2P(LANG_CONTRAST), remote_contrast }, { ID2P(LANG_INVERT), remote_invert }, /* { ID2P(LANG_FLIP_DISPLAY), remote_flip_display }, -- cgit v1.1