summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-03-19 00:34:56 +0000
committerJens Arnold <amiconn@rockbox.org>2008-03-19 00:34:56 +0000
commit8e66491ffea4543dd2d96f1fc8dab7f822125302 (patch)
tree371eede16926d3ca3499949d294f0b3cb2f70ef1 /firmware/backlight.c
parentba193a80652f8fcf343a4c489a7d44820dfb3281 (diff)
M3: Make remote LCD hotplug work, and make 'backlight on button hold' use the correct hold switch. * Kill a warning.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16711 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c31
1 files changed, 23 insertions, 8 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 181ead71a1..0f66fbf574 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -30,10 +30,8 @@
#include "button.h"
#include "timer.h"
#include "backlight.h"
+#include "lcd.h"
-#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
-#include "lcd.h" /* for lcd_enable() and lcd_sleep() */
-#endif
#ifdef HAVE_REMOTE_LCD
#include "lcd-remote.h"
#endif
@@ -367,7 +365,13 @@ void backlight_set_fade_out(int value)
static void backlight_update_state(void)
{
#ifdef HAS_BUTTON_HOLD
- if (button_hold() && (backlight_on_button_hold != 0))
+ if ((backlight_on_button_hold != 0)
+#ifdef HAVE_REMOTE_LCD_AS_MAIN
+ && remote_button_hold()
+#else
+ && button_hold()
+#endif
+ )
backlight_timeout = (backlight_on_button_hold == 2) ? 0 : -1;
/* always on or always off */
else
@@ -375,9 +379,9 @@ static void backlight_update_state(void)
#if CONFIG_CHARGING
if (charger_inserted()
#ifdef HAVE_USB_POWER
- || usb_powered()
+ || usb_powered()
#endif
- )
+ )
backlight_timeout = backlight_timeout_plugged;
else
#endif
@@ -452,8 +456,9 @@ void backlight_thread(void)
break;
#endif
-#if defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR)
+#ifndef SIMULATOR
/* Here for now or else the aggressive init messes up scrolling */
+#ifdef HAVE_REMOTE_LCD
case SYS_REMOTE_PLUGGED:
lcd_remote_on();
lcd_remote_update();
@@ -462,7 +467,17 @@ void backlight_thread(void)
case SYS_REMOTE_UNPLUGGED:
lcd_remote_off();
break;
-#endif /* defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR) */
+#elif defined HAVE_REMOTE_LCD_AS_MAIN
+ case SYS_REMOTE_PLUGGED:
+ lcd_on();
+ lcd_update();
+ break;
+
+ case SYS_REMOTE_UNPLUGGED:
+ lcd_off();
+ break;
+#endif /* HAVE_REMOTE_LCD/ HAVE_REMOTE_LCD_AS_MAIN */
+#endif /* !SIMULATOR */
#ifdef SIMULATOR
/* This one here too for lack of a better place */
case SYS_SCREENDUMP: