summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2008-11-26 08:26:13 +0000
committerSteve Bavin <pondlife@pondlife.me>2008-11-26 08:26:13 +0000
commitf6847265804b650b007eb8ecdc86876214ee7302 (patch)
tree5f92d0097167f2e5c257b42427fd182e704ae4c1 /apps
parent756bcc4bd53b34371c073c8468cbd8c01ffe094a (diff)
Add software backlight fading for E100/H300/X5/D2, by Thomas Martitz and others - see FS#6800 for credits.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19221 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/features.txt2
-rw-r--r--apps/menus/display_menu.c8
-rw-r--r--apps/settings.c3
-rw-r--r--apps/settings.h6
-rw-r--r--apps/settings_list.c5
5 files changed, 18 insertions, 6 deletions
diff --git a/apps/features.txt b/apps/features.txt
index 118465a535..0a01eb92c7 100644
--- a/apps/features.txt
+++ b/apps/features.txt
@@ -20,7 +20,7 @@ albumart
backlight_brightness
#endif
-#if defined(HAVE_BACKLIGHT_PWM_FADING)
+#if defined(HAVE_BACKLIGHT_PWM_FADING) || defined(USE_BACKLIGHT_SW_FADING)
backlight_fade
#endif
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index 016255bad1..744a9e9354 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -91,7 +91,8 @@ MENUITEM_SETTING(backlight_on_button_hold,
&global_settings.backlight_on_button_hold, NULL);
#endif
MENUITEM_SETTING(caption_backlight, &global_settings.caption_backlight, NULL);
-#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
+#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) || \
+ defined(USE_BACKLIGHT_SW_FADING)
MENUITEM_SETTING(backlight_fade_in, &global_settings.backlight_fade_in, NULL);
MENUITEM_SETTING(backlight_fade_out, &global_settings.backlight_fade_out, NULL);
#endif
@@ -130,9 +131,10 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
,&backlight_on_button_hold
# endif
,&caption_backlight
-# if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
+#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) || \
+ defined(USE_BACKLIGHT_SW_FADING)
,&backlight_fade_in, &backlight_fade_out
-# endif
+#endif
,&bl_filter_first_keypress
# ifdef HAVE_LCD_SLEEP_SETTING
,&lcd_sleep_after_backlight_off
diff --git a/apps/settings.c b/apps/settings.c
index bdfaba2f44..2cab26a4a1 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -768,7 +768,8 @@ void settings_apply(bool read_disk)
#if CONFIG_CHARGING
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
#endif
-#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
+#if (defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)) \
+ || defined(USE_BACKLIGHT_SW_FADING)
backlight_set_fade_in(global_settings.backlight_fade_in);
backlight_set_fade_out(global_settings.backlight_fade_out);
#endif
diff --git a/apps/settings.h b/apps/settings.h
index c5658aaf09..56b7d3e80a 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -421,10 +421,14 @@ struct user_settings
int backlight_timeout_plugged;
#endif
-#ifdef HAVE_BACKLIGHT_PWM_FADING
+#if defined(HAVE_BACKLIGHT_PWM_FADING)
int backlight_fade_in; /* backlight fade in timing: 0..3 */
int backlight_fade_out; /* backlight fade in timing: 0..7 */
+#elif defined(USE_BACKLIGHT_SW_FADING)
+ bool backlight_fade_in;
+ bool backlight_fade_out;
#endif
+
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
int brightness;
#endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 6a7fcc3aec..f4519f5975 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -679,6 +679,11 @@ const struct settings_list settings[] = {
UNIT_MS, formatter_unit_0_is_off, getlang_unit_0_is_off,
backlight_set_fade_out, 10,
0,100,200,300,500,1000,2000,3000,5000,10000),
+#elif defined(USE_BACKLIGHT_SW_FADING)
+ OFFON_SETTING(0, backlight_fade_in, LANG_BACKLIGHT_FADE_IN,
+ true, "backlight fade in", backlight_set_fade_in),
+ OFFON_SETTING(0, backlight_fade_out, LANG_BACKLIGHT_FADE_OUT,
+ true, "backlight fade out", backlight_set_fade_out),
#endif
INT_SETTING(F_PADTITLE, scroll_speed, LANG_SCROLL_SPEED, 9,"scroll speed",
UNIT_INT, 0, 15, 1, NULL, NULL, lcd_scroll_speed),