summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2005-05-30 00:00:22 +0000
committerChristian Gmeiner <christian.gmeiner@gmail.com>2005-05-30 00:00:22 +0000
commit7477c09b42a02484dadbe8da700e8c18e29ffef2 (patch)
tree412177813e4dbf2d9c45b4c50cd3366139ec695a /firmware
parent4cdc7ca987d45d4d790281c21f3b7190beefaf65 (diff)
downloadrockbox-7477c09b42a02484dadbe8da700e8c18e29ffef2.tar.gz
rockbox-7477c09b42a02484dadbe8da700e8c18e29ffef2.zip
Remote LCD: added own backlight timeout stuff
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6533 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/backlight.c14
-rw-r--r--firmware/export/backlight.h6
2 files changed, 18 insertions, 2 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index e430583d2d..af4dfeadd2 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -53,10 +53,11 @@ static bool charger_was_inserted = 0;
static bool backlight_on_when_charging = 0;
static int backlight_timer;
+static unsigned int backlight_timeout = 5;
#ifdef HAVE_REMOTE_LCD
static int remote_backlight_timer;
+static unsigned int remote_backlight_timeout = 5;
#endif
-static unsigned int backlight_timeout = 5;
static void __backlight_off(void)
{
@@ -103,7 +104,7 @@ void backlight_thread(void)
#ifdef HAVE_REMOTE_LCD
case REMOTE_BACKLIGHT_ON:
remote_backlight_timer =
- HZ*backlight_timeout_value[backlight_timeout];
+ HZ*backlight_timeout_value[remote_backlight_timeout];
/* Backlight == OFF in the setting? */
if(remote_backlight_timer < 0)
@@ -181,6 +182,15 @@ void remote_backlight_off(void)
{
queue_post(&backlight_queue, REMOTE_BACKLIGHT_OFF, NULL);
}
+
+void remote_backlight_set_timeout(int index)
+{
+ if((unsigned)index >= sizeof(backlight_timeout_value))
+ /* if given a weird value, use 0 */
+ index=0;
+ remote_backlight_timeout = index; /* index in the backlight_timeout_value table */
+ remote_backlight_on();
+}
#endif
int backlight_get_timeout(void)
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h
index 6025fbaf3b..ab1f9059b2 100644
--- a/firmware/export/backlight.h
+++ b/firmware/export/backlight.h
@@ -19,6 +19,8 @@
#ifndef BACKLIGHT_H
#define BACKLIGHT_H
+#include "config.h"
+
void backlight_init(void);
void backlight_on(void);
void backlight_off(void);
@@ -31,4 +33,8 @@ void remote_backlight_on(void);
void remote_backlight_off(void);
extern const char backlight_timeout_value[];
+#ifdef HAVE_REMOTE_LCD
+void remote_backlight_set_timeout(int index);
+#endif
+
#endif