Accepted FS #5772 by Michael Sevakis

1. X5 lcd sleep
2. #define HAVE_LCD_ENABLE
3. add "backlight (on hold switch)" setting, adapted from FS #5735

Note that the while(1) yield ==> asm("halt") part is NOT commited here,
I prefer it would be discussed separately.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10489 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rani Hod 2006-08-08 22:03:56 +00:00
parent f8866a3a9c
commit c9f59e6f75
17 changed files with 644 additions and 211 deletions

View file

@ -196,6 +196,21 @@ static bool backlight_timer(void)
backlight_set_timeout );
}
#ifdef HAS_BUTTON_HOLD
static bool 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.backlight_on_button_hold,
INT, names, 3,
backlight_set_on_button_hold);
}
#endif /* HAS_BUTTON_HOLD */
#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
static bool backlight_fade_in(void)
{
@ -227,6 +242,29 @@ static bool backlight_fade_out(void)
INT, names, 8, backlight_set_fade_out );
}
#endif
#ifdef HAVE_LCD_SLEEP
static bool lcd_sleep_after_backlight_off(void)
{
static const struct opt_items names[] = {
{ STR(LANG_ALWAYS) },
{ STR(LANG_NEVER) },
{ (unsigned char *)"5s", TALK_ID(5, UNIT_SEC) },
{ (unsigned char *)"10s", TALK_ID(10, UNIT_SEC) },
{ (unsigned char *)"15s", TALK_ID(15, UNIT_SEC) },
{ (unsigned char *)"20s", TALK_ID(20, UNIT_SEC) },
{ (unsigned char *)"30s", TALK_ID(30, UNIT_SEC) },
{ (unsigned char *)"45s", TALK_ID(45, UNIT_SEC) },
{ (unsigned char *)"60s", TALK_ID(60, UNIT_SEC) },
{ (unsigned char *)"90s", TALK_ID(90, UNIT_SEC) },
};
return set_option(str(LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF),
&global_settings.lcd_sleep_after_backlight_off,
INT, names, 10,
lcd_set_sleep_after_backlight_off );
}
#endif /* HAVE_LCD_SLEEP */
#endif /* CONFIG_BACKLIGHT */
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
@ -257,7 +295,7 @@ static bool remote_backlight_timer_plugged(void)
INT, backlight_timeouts, 19,
remote_backlight_set_timeout_plugged );
}
#endif
#endif /* HAVE_REMOTE_LCD */
static bool remote_caption_backlight(void)
{
@ -1770,6 +1808,9 @@ static bool lcd_settings_menu(void)
{ ID2P(LANG_BACKLIGHT), backlight_timer },
#ifdef CONFIG_CHARGING
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_timer_plugged },
#endif
#ifdef HAS_BUTTON_HOLD
{ ID2P(LANG_BACKLIGHT_ON_BUTTON_HOLD), backlight_on_button_hold },
#endif
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
@ -1777,6 +1818,9 @@ static bool lcd_settings_menu(void)
{ ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out },
#endif
{ ID2P(LANG_BACKLIGHT_FILTER_FIRST_KEYPRESS), set_bl_filter_first_keypress },
#ifdef HAVE_LCD_SLEEP
{ ID2P(LANG_LCD_SLEEP_AFTER_BACKLIGHT_OFF), lcd_sleep_after_backlight_off },
#endif
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
{ ID2P(LANG_BRIGHTNESS), brightness },
#endif