diff options
author | Hristo Kovachev <bger@rockbox.org> | 2006-04-01 12:20:23 +0000 |
---|---|---|
committer | Hristo Kovachev <bger@rockbox.org> | 2006-04-01 12:20:23 +0000 |
commit | 8c15138008b108a0ab3d90ef9f09c6d3fc59f740 (patch) | |
tree | 525f9c3e47e27aaffbc9c9d158eacde1889ad970 /firmware | |
parent | 42c8e5c769bd6f2ae26ca8013f2b068d0bfdcc4b (diff) | |
download | rockbox-8c15138008b108a0ab3d90ef9f09c6d3fc59f740.tar.gz rockbox-8c15138008b108a0ab3d90ef9f09c6d3fc59f740.zip |
Patch #4934 by Ralf Herz: Fixes
1) Backlight stays on when set to always off (at least on the iPods (signed/unsigned problem))
2) Buttons not working when the backlight is set to always off and turned on the "first keypress enables backlight only"
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9396 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.c | 9 | ||||
-rw-r--r-- | firmware/export/backlight.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 97c9175a4b..a84fc8b280 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -137,7 +137,7 @@ static inline void __backlight_off(void) | |||
137 | 137 | ||
138 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) | 138 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) |
139 | 139 | ||
140 | const char backlight_timeout_value[19] = | 140 | const signed char backlight_timeout_value[19] = |
141 | { | 141 | { |
142 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90 | 142 | -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90 |
143 | }; | 143 | }; |
@@ -522,9 +522,10 @@ void backlight_off(void) | |||
522 | queue_post(&backlight_queue, BACKLIGHT_OFF, NULL); | 522 | queue_post(&backlight_queue, BACKLIGHT_OFF, NULL); |
523 | } | 523 | } |
524 | 524 | ||
525 | /* returns true when the backlight is on OR when it's set to always off */ | ||
525 | bool is_backlight_on(void) | 526 | bool is_backlight_on(void) |
526 | { | 527 | { |
527 | if (backlight_timer || !backlight_get_current_timeout()) | 528 | if (backlight_timer || backlight_get_current_timeout() <= 0) |
528 | return true; | 529 | return true; |
529 | else | 530 | else |
530 | return false; | 531 | return false; |
@@ -615,9 +616,11 @@ int remote_backlight_get_current_timeout(void) | |||
615 | #endif | 616 | #endif |
616 | } | 617 | } |
617 | 618 | ||
619 | /* returns true when the backlight is on OR when it's set to always off */ | ||
618 | bool is_remote_backlight_on(void) | 620 | bool is_remote_backlight_on(void) |
619 | { | 621 | { |
620 | if (remote_backlight_timer != 0 || !remote_backlight_get_current_timeout()) | 622 | if (remote_backlight_timer != 0 || |
623 | remote_backlight_get_current_timeout() <= 0) | ||
621 | return true; | 624 | return true; |
622 | else | 625 | else |
623 | return false; | 626 | return false; |
diff --git a/firmware/export/backlight.h b/firmware/export/backlight.h index 508d472381..c1a7ade38f 100644 --- a/firmware/export/backlight.h +++ b/firmware/export/backlight.h | |||
@@ -33,7 +33,7 @@ void backlight_set_fade_in(int index); | |||
33 | void backlight_set_fade_out(int index); | 33 | void backlight_set_fade_out(int index); |
34 | #endif | 34 | #endif |
35 | void backlight_set_timeout_plugged(int index); | 35 | void backlight_set_timeout_plugged(int index); |
36 | extern const char backlight_timeout_value[]; | 36 | extern const signed char backlight_timeout_value[]; |
37 | #else | 37 | #else |
38 | #define backlight_init() | 38 | #define backlight_init() |
39 | #endif | 39 | #endif |