diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-03-19 00:34:56 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-03-19 00:34:56 +0000 |
commit | 8e66491ffea4543dd2d96f1fc8dab7f822125302 (patch) | |
tree | 371eede16926d3ca3499949d294f0b3cb2f70ef1 /firmware/backlight.c | |
parent | ba193a80652f8fcf343a4c489a7d44820dfb3281 (diff) | |
download | rockbox-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
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r-- | firmware/backlight.c | 31 |
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 @@ | |||
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) | |||
367 | static void backlight_update_state(void) | 365 | static 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: |