summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-04-25 18:15:50 +0000
committerThomas Martitz <kugel@rockbox.org>2009-04-25 18:15:50 +0000
commit0017dfbe8291142aefa832cf6c34e039376b826d (patch)
tree7b5feb594436247667669577ba4605a07de80fd1 /firmware
parent67fb5415f78a3198030a6285d1ccc641044f149b (diff)
Rename _buttonlight_timeout and use a function call instead of extern'ing buttonlight_timeout to be more inline with backlight, and use a #define instead of a const variable for !HAVE_LCD_SLEEP_SETTING (no functional changes)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20784 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight.c19
-rw-r--r--firmware/export/backlight.h2
-rw-r--r--firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c2
3 files changed, 14 insertions, 9 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 283958f8ca..2d9c963cab 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -49,9 +49,6 @@
#define BACKLIGHT_FULL_INIT
#endif
-#ifdef HAVE_BACKLIGHT_BRIGHTNESS
-int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
-#endif
#if (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_SETTING) \
|| (CONFIG_BACKLIGHT_FADING == BACKLIGHT_FADING_SW_HW_REG)
@@ -135,6 +132,9 @@ static struct event_queue backlight_queue;
static unsigned int backlight_thread_id = 0;
#endif
+#ifdef HAVE_BACKLIGHT_BRIGHTNESS
+int backlight_brightness = DEFAULT_BRIGHTNESS_SETTING;
+#endif
static int backlight_timer SHAREDBSS_ATTR;
static int backlight_timeout SHAREDBSS_ATTR;
static int backlight_timeout_normal = 5*HZ;
@@ -147,12 +147,12 @@ static int backlight_on_button_hold = 0;
#ifdef HAVE_BUTTON_LIGHT
static int buttonlight_timer;
-int _buttonlight_timeout = 5*HZ;
+static int buttonlight_timeout = 5*HZ;
/* Update state of buttonlight according to timeout setting */
static void buttonlight_update_state(void)
{
- buttonlight_timer = _buttonlight_timeout;
+ buttonlight_timer = buttonlight_timeout;
/* Buttonlight == OFF in the setting? */
if (buttonlight_timer < 0)
@@ -178,10 +178,15 @@ void buttonlight_off(void)
void buttonlight_set_timeout(int value)
{
- _buttonlight_timeout = HZ * value;
+ buttonlight_timeout = HZ * value;
queue_post(&backlight_queue, BUTTON_LIGHT_TMO_CHANGED, 0);
}
+int buttonlight_get_current_timeout(void)
+{
+ return buttonlight_timeout;
+}
+
#endif /* HAVE_BUTTON_LIGHT */
#ifdef HAVE_REMOTE_LCD
@@ -205,7 +210,7 @@ const signed char lcd_sleep_timeout_value[10] =
static int lcd_sleep_timeout = 10*HZ;
#else
/* Target defines needed value */
-static const int lcd_sleep_timeout = LCD_SLEEP_TIMEOUT;
+#define lcd_sleep_timeout LCD_SLEEP_TIMEOUT
#endif
static int lcd_sleep_timer SHAREDDATA_ATTR = 0;
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index f215e0faea..ad06a670e1 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -95,7 +95,7 @@ void buttonlight_set_timeout(int value);
/* Private API for use in target tree backlight code only */
#ifdef HAVE_BUTTON_LIGHT
-extern int _buttonlight_timeout;
+int buttonlight_get_current_timeout(void);
#endif
#endif /* BACKLIGHT_H */
diff --git a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
index 2d8fad5555..b38f18d4f9 100644
--- a/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
+++ b/firmware/target/arm/s3c2440/gigabeat-fx/backlight-meg-fx.c
@@ -388,7 +388,7 @@ void _buttonlight_on(void)
void _buttonlight_off(void)
{
#ifndef BOOTLOADER
- if(_buttonlight_timeout>0)
+ if(buttonlight_get_current_timeout() > 0)
__buttonlight_dim(true);
else
#endif