diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-22 14:33:07 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2006-03-22 14:33:07 +0000 |
commit | 9a6997753d18de86942839319edc0a8fada0c5a5 (patch) | |
tree | 94fc3bd7e763c699e9920dfb1ecc1df27b9f9cc6 /firmware | |
parent | 13618007b36b60dda1425ada261308a3624224c3 (diff) | |
download | rockbox-9a6997753d18de86942839319edc0a8fada0c5a5.tar.gz rockbox-9a6997753d18de86942839319edc0a8fada0c5a5.zip |
Fix simulator backlight for X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9186 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/backlight.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/firmware/backlight.c b/firmware/backlight.c index 89a9939213..7811881fa3 100644 --- a/firmware/backlight.c +++ b/firmware/backlight.c | |||
@@ -44,14 +44,23 @@ | |||
44 | #include "backlight-target.h" | 44 | #include "backlight-target.h" |
45 | #endif | 45 | #endif |
46 | 46 | ||
47 | #ifdef SIMULATOR | ||
48 | void __backlight_on(void) | ||
49 | { | ||
50 | sim_backlight(100); | ||
51 | } | ||
52 | |||
53 | static inline void __backlight_off(void) | ||
54 | { | ||
55 | sim_backlight(0); | ||
56 | } | ||
57 | #else | ||
47 | /* Basic low-level code that simply switches backlight on or off. Probably | 58 | /* Basic low-level code that simply switches backlight on or off. Probably |
48 | * a nice candidate for inclusion in the target/ dir. */ | 59 | * a nice candidate for inclusion in the target/ dir. */ |
49 | #ifndef TARGET_TREE | 60 | #ifndef TARGET_TREE |
50 | static inline void __backlight_on(void) | 61 | static inline void __backlight_on(void) |
51 | { | 62 | { |
52 | #ifdef SIMULATOR | 63 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 |
53 | sim_backlight(100); | ||
54 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H100 | ||
55 | and_l(~0x00020000, &GPIO1_OUT); | 64 | and_l(~0x00020000, &GPIO1_OUT); |
56 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 | 65 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 |
57 | lcd_enable(true); | 66 | lcd_enable(true); |
@@ -90,9 +99,7 @@ static inline void __backlight_on(void) | |||
90 | 99 | ||
91 | static inline void __backlight_off(void) | 100 | static inline void __backlight_off(void) |
92 | { | 101 | { |
93 | #ifdef SIMULATOR | 102 | #if CONFIG_BACKLIGHT == BL_IRIVER_H100 |
94 | sim_backlight(0); | ||
95 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H100 | ||
96 | or_l(0x00020000, &GPIO1_OUT); | 103 | or_l(0x00020000, &GPIO1_OUT); |
97 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 | 104 | #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 |
98 | and_l(~0x00020000, &GPIO1_OUT); | 105 | and_l(~0x00020000, &GPIO1_OUT); |
@@ -126,6 +133,7 @@ static inline void __backlight_off(void) | |||
126 | #endif | 133 | #endif |
127 | } | 134 | } |
128 | #endif | 135 | #endif |
136 | #endif /* SIMULATOR */ | ||
129 | 137 | ||
130 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) | 138 | #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) |
131 | 139 | ||