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
This commit is contained in:
Jens Arnold 2008-03-19 00:34:56 +00:00
parent ba193a8065
commit 8e66491ffe
4 changed files with 34 additions and 9 deletions

View file

@ -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:

View file

@ -47,6 +47,9 @@
#define LCD_PIXELFORMAT VERTICAL_INTERLEAVED
/* define this if only the remote has an LCD */
#define HAVE_REMOTE_LCD_AS_MAIN
#define CONFIG_KEYPAD IAUDIO_M3_PAD
#define AB_REPEAT_ENABLE 1

View file

@ -331,6 +331,12 @@ static inline unsigned lcd_color_to_native(unsigned color)
extern fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
/** Port-specific functions. Enable in port config file. **/
#ifdef HAVE_REMOTE_LCD_AS_MAIN
void lcd_on(void);
void lcd_off(void);
void lcd_poweroff(void);
#endif
#ifdef HAVE_LCD_ENABLE
/* Enable/disable the main display. */
extern void lcd_enable(bool on);

View file

@ -21,8 +21,9 @@
#include "cpu.h"
#include <stdbool.h>
#include "kernel.h"
#include "system.h"
#include "lcd.h"
#include "power.h"
#include "system.h"
#ifndef SIMULATOR