summaryrefslogtreecommitdiff
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
parentba193a80652f8fcf343a4c489a7d44820dfb3281 (diff)
downloadrockbox-8e66491ffea4543dd2d96f1fc8dab7f822125302.tar.gz
rockbox-8e66491ffea4543dd2d96f1fc8dab7f822125302.zip
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
-rw-r--r--firmware/backlight.c31
-rw-r--r--firmware/export/config-iaudiom3.h3
-rw-r--r--firmware/export/lcd.h6
-rw-r--r--firmware/target/coldfire/iaudio/m3/power-m3.c3
4 files changed, 34 insertions, 9 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 @@
30#include "button.h" 30#include "button.h"
31#include "timer.h" 31#include "timer.h"
32#include "backlight.h" 32#include "backlight.h"
33#include "lcd.h"
33 34
34#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
35#include "lcd.h" /* for lcd_enable() and lcd_sleep() */
36#endif
37#ifdef HAVE_REMOTE_LCD 35#ifdef HAVE_REMOTE_LCD
38#include "lcd-remote.h" 36#include "lcd-remote.h"
39#endif 37#endif
@@ -367,7 +365,13 @@ void backlight_set_fade_out(int value)
367static void backlight_update_state(void) 365static void backlight_update_state(void)
368{ 366{
369#ifdef HAS_BUTTON_HOLD 367#ifdef HAS_BUTTON_HOLD
370 if (button_hold() && (backlight_on_button_hold != 0)) 368 if ((backlight_on_button_hold != 0)
369#ifdef HAVE_REMOTE_LCD_AS_MAIN
370 && remote_button_hold()
371#else
372 && button_hold()
373#endif
374 )
371 backlight_timeout = (backlight_on_button_hold == 2) ? 0 : -1; 375 backlight_timeout = (backlight_on_button_hold == 2) ? 0 : -1;
372 /* always on or always off */ 376 /* always on or always off */
373 else 377 else
@@ -375,9 +379,9 @@ static void backlight_update_state(void)
375#if CONFIG_CHARGING 379#if CONFIG_CHARGING
376 if (charger_inserted() 380 if (charger_inserted()
377#ifdef HAVE_USB_POWER 381#ifdef HAVE_USB_POWER
378 || usb_powered() 382 || usb_powered()
379#endif 383#endif
380 ) 384 )
381 backlight_timeout = backlight_timeout_plugged; 385 backlight_timeout = backlight_timeout_plugged;
382 else 386 else
383#endif 387#endif
@@ -452,8 +456,9 @@ void backlight_thread(void)
452 break; 456 break;
453#endif 457#endif
454 458
455#if defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR) 459#ifndef SIMULATOR
456 /* Here for now or else the aggressive init messes up scrolling */ 460 /* Here for now or else the aggressive init messes up scrolling */
461#ifdef HAVE_REMOTE_LCD
457 case SYS_REMOTE_PLUGGED: 462 case SYS_REMOTE_PLUGGED:
458 lcd_remote_on(); 463 lcd_remote_on();
459 lcd_remote_update(); 464 lcd_remote_update();
@@ -462,7 +467,17 @@ void backlight_thread(void)
462 case SYS_REMOTE_UNPLUGGED: 467 case SYS_REMOTE_UNPLUGGED:
463 lcd_remote_off(); 468 lcd_remote_off();
464 break; 469 break;
465#endif /* defined(HAVE_REMOTE_LCD) && !defined(SIMULATOR) */ 470#elif defined HAVE_REMOTE_LCD_AS_MAIN
471 case SYS_REMOTE_PLUGGED:
472 lcd_on();
473 lcd_update();
474 break;
475
476 case SYS_REMOTE_UNPLUGGED:
477 lcd_off();
478 break;
479#endif /* HAVE_REMOTE_LCD/ HAVE_REMOTE_LCD_AS_MAIN */
480#endif /* !SIMULATOR */
466#ifdef SIMULATOR 481#ifdef SIMULATOR
467 /* This one here too for lack of a better place */ 482 /* This one here too for lack of a better place */
468 case SYS_SCREENDUMP: 483 case SYS_SCREENDUMP:
diff --git a/firmware/export/config-iaudiom3.h b/firmware/export/config-iaudiom3.h
index 8e4b4976f9..67415b8d19 100644
--- a/firmware/export/config-iaudiom3.h
+++ b/firmware/export/config-iaudiom3.h
@@ -47,6 +47,9 @@
47 47
48#define LCD_PIXELFORMAT VERTICAL_INTERLEAVED 48#define LCD_PIXELFORMAT VERTICAL_INTERLEAVED
49 49
50/* define this if only the remote has an LCD */
51#define HAVE_REMOTE_LCD_AS_MAIN
52
50#define CONFIG_KEYPAD IAUDIO_M3_PAD 53#define CONFIG_KEYPAD IAUDIO_M3_PAD
51 54
52#define AB_REPEAT_ENABLE 1 55#define AB_REPEAT_ENABLE 1
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 474500db5f..18a28d9569 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -331,6 +331,12 @@ static inline unsigned lcd_color_to_native(unsigned color)
331extern fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH]; 331extern fb_data lcd_framebuffer[LCD_FBHEIGHT][LCD_FBWIDTH];
332 332
333/** Port-specific functions. Enable in port config file. **/ 333/** Port-specific functions. Enable in port config file. **/
334#ifdef HAVE_REMOTE_LCD_AS_MAIN
335void lcd_on(void);
336void lcd_off(void);
337void lcd_poweroff(void);
338#endif
339
334#ifdef HAVE_LCD_ENABLE 340#ifdef HAVE_LCD_ENABLE
335/* Enable/disable the main display. */ 341/* Enable/disable the main display. */
336extern void lcd_enable(bool on); 342extern void lcd_enable(bool on);
diff --git a/firmware/target/coldfire/iaudio/m3/power-m3.c b/firmware/target/coldfire/iaudio/m3/power-m3.c
index 475f64ec4a..04eb360194 100644
--- a/firmware/target/coldfire/iaudio/m3/power-m3.c
+++ b/firmware/target/coldfire/iaudio/m3/power-m3.c
@@ -21,8 +21,9 @@
21#include "cpu.h" 21#include "cpu.h"
22#include <stdbool.h> 22#include <stdbool.h>
23#include "kernel.h" 23#include "kernel.h"
24#include "system.h" 24#include "lcd.h"
25#include "power.h" 25#include "power.h"
26#include "system.h"
26 27
27#ifndef SIMULATOR 28#ifndef SIMULATOR
28 29