summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2006-03-19 17:42:58 +0000
committerThom Johansen <thomj@rockbox.org>2006-03-19 17:42:58 +0000
commit3c7278f405acd1dce7393cd589fbe002f51bad3b (patch)
tree027b12d8f8c10af9d6bdd9f6dc31e3413c175a5c /apps
parentea4ccb5abab7f3a775b0c1fee1a50a8840b09d47 (diff)
Reworked backlight fading by GPIO based PWM to work for other targets
than H1x0. iPod Nano and 5G backlight fading is enabled. To try for your device, just define HAVE_BACKLIGHT_PWM_FADING in the relevant config-xxxx.h file. NOTE: Will break your settings, so save a config file first. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9121 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/settings.c6
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_menu.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/apps/settings.c b/apps/settings.c
index 6fedf66669..7329b12a76 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -90,7 +90,7 @@ const char rec_base_directory[] = REC_BASE_DIR;
#include "dsp.h"
#endif
-#define CONFIG_BLOCK_VERSION 37
+#define CONFIG_BLOCK_VERSION 38
#define CONFIG_BLOCK_SIZE 512
#define RTC_BLOCK_SIZE 44
@@ -436,7 +436,7 @@ static const struct bit_entry hd_bits[] =
{4, S_O(rec_trigger_mode ), 0, "trigger mode", "off,once,repeat"},
#endif
-#if CONFIG_BACKLIGHT == BL_IRIVER_H100
+#ifdef HAVE_BACKLIGHT_PWM_FADING
/* backlight fading */
{2, S_O(backlight_fade_in), 1, "backlight fade in", "off,500ms,1s,2s"},
{3, S_O(backlight_fade_out), 3, "backlight fade out",
@@ -997,7 +997,7 @@ void settings_apply(void)
#ifdef HAVE_CHARGING
backlight_set_timeout_plugged(global_settings.backlight_timeout_plugged);
#endif
-#if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR)
+#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
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 3d129ba6e6..52e949ea9e 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -271,7 +271,7 @@ struct user_settings
1=always,
then according to timeout_values[] */
int backlight_timeout_plugged;
-#if CONFIG_BACKLIGHT == BL_IRIVER_H100
+#ifdef HAVE_BACKLIGHT_PWM_FADING
int backlight_fade_in; /* backlight fade in timing: 0..3 */
int backlight_fade_out; /* backlight fade in timing: 0..7 */
#endif
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 517c7f1f6b..6e8d62191f 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -191,7 +191,7 @@ static bool backlight_timer(void)
backlight_set_timeout );
}
-#if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR)
+#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
static bool backlight_fade_in(void)
{
static const struct opt_items names[] = {
@@ -1087,7 +1087,7 @@ static bool custom_remote_wps_browse(void)
return rockbox_browse(WPS_DIR, SHOW_RWPS);
}
#endif
-
+
static bool custom_cfg_browse(void)
{
return rockbox_browse(ROCKBOX_DIR, SHOW_CFG);
@@ -1614,7 +1614,7 @@ static bool lcd_settings_menu(void)
{ ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_timer_plugged },
#endif
{ ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight },
-#if (CONFIG_BACKLIGHT == BL_IRIVER_H100) && !defined(SIMULATOR)
+#if defined(HAVE_BACKLIGHT_PWM_FADING) && !defined(SIMULATOR)
{ ID2P(LANG_BACKLIGHT_FADE_IN), backlight_fade_in },
{ ID2P(LANG_BACKLIGHT_FADE_OUT), backlight_fade_out },
#endif