From 3d2e10bcbd13ec48decafe49f32afcc12c5e185a Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sun, 10 Sep 2006 02:00:40 +0000 Subject: Added remote backlight on hold option to players with remote hold switch. Disabled IRQs while reading pcf50606 ADC. This seems to have stopped buttons becoming unresponsive when using remote. Maybe fixes other button glitches as well? git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10911 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 11 +++++++++++ apps/settings.h | 12 +++++++++--- apps/settings_menu.c | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/settings.c b/apps/settings.c index 8dcad6bae4..d2b220f893 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -647,6 +647,14 @@ static const struct bit_entry hd_bits[] = {8|SIGNED, S_O(rec_agc_maxgain_line), 96, "agc maximum line gain", NULL}, {3, S_O(rec_agc_cliptime), 1, "agc cliptime", "0.2s,0.4s,0.6s,0.8,1s"}, #endif + +#ifdef HAVE_REMOTE_LCD +#ifdef HAS_REMOTE_BUTTON_HOLD + {2, S_O(remote_backlight_on_button_hold), 0, "remote backlight on button hold", + "normal,off,on" }, +#endif +#endif + /* If values are just added to the end, no need to bump the version. */ /* new stuff to be added at the end */ @@ -1108,7 +1116,10 @@ void settings_apply(void) #ifdef CONFIG_CHARGING remote_backlight_set_timeout_plugged(global_settings.remote_backlight_timeout_plugged); #endif +#ifdef HAS_REMOTE_BUTTON_HOLD + remote_backlight_set_on_button_hold(global_settings.remote_backlight_on_button_hold); #endif +#endif /* HAVE_REMOTE_LCD */ #ifdef CONFIG_BACKLIGHT backlight_set_timeout(global_settings.backlight_timeout); #ifdef CONFIG_CHARGING diff --git a/apps/settings.h b/apps/settings.h index b66e96b765..561dc59375 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -354,11 +354,15 @@ struct user_settings then according to timeout_values[] */ int remote_backlight_timeout_plugged; bool remote_caption_backlight; /* turn on backlight at end and start of track */ +#ifdef HAS_REMOTE_BUTTON_HOLD + int remote_backlight_on_button_hold; /* what to do with remote backlight when hold + switch is on */ +#endif #ifdef HAVE_REMOTE_LCD_TICKING bool remote_reduce_ticking; /* 0=normal operation, 1=EMI reduce on with cost more CPU. */ #endif -#endif +#endif /* HAVE_REMOTE_LCD */ bool next_folder; /* move to next folder */ bool runtimedb; /* runtime database active? */ @@ -446,10 +450,12 @@ struct user_settings bool remote_bl_filter_first_keypress; /* filter first remote keypress when remote dark? */ #endif #ifdef HAS_BUTTON_HOLD - int backlight_on_button_hold; + int backlight_on_button_hold; /* what to do with backlight when hold + switch is on */ #endif #ifdef HAVE_LCD_SLEEP - int lcd_sleep_after_backlight_off; + int lcd_sleep_after_backlight_off; /* when to put lcd to sleep after backlight + has turned off */ #endif #endif /* CONFIG_BACKLIGHT */ diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 5f84dc1d34..ab19c820be 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -315,6 +315,22 @@ static bool remote_caption_backlight(void) return set_bool((char *)str(LANG_CAPTION_BACKLIGHT), &global_settings.remote_caption_backlight); } + +#ifdef HAS_REMOTE_BUTTON_HOLD +static bool remote_backlight_on_button_hold(void) +{ + static const struct opt_items names[3] = { + { STR(LANG_BACKLIGHT_ON_BUTTON_HOLD_NORMAL) }, + { STR(LANG_OFF) }, + { STR(LANG_ON) }, + }; + return set_option(str(LANG_BACKLIGHT_ON_BUTTON_HOLD), + &global_settings.remote_backlight_on_button_hold, + INT, names, 3, + remote_backlight_set_on_button_hold); +} +#endif /* HAS_BUTTON_HOLD */ + #endif /* HAVE_REMOTE_LCD */ #ifdef HAVE_LCD_CONTRAST @@ -1886,6 +1902,9 @@ static bool lcd_remote_settings_menu(void) #ifdef CONFIG_CHARGING { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), remote_backlight_timer_plugged }, +#endif +#ifdef HAS_REMOTE_BUTTON_HOLD + { ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD), remote_backlight_on_button_hold }, #endif { ID2P(LANG_CAPTION_BACKLIGHT), remote_caption_backlight }, { ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_remote_bl_filter_first_keypress }, -- cgit v1.2.3