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/backlight.c | |
parent | 13618007b36b60dda1425ada261308a3624224c3 (diff) |
Fix simulator backlight for X5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9186 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/backlight.c')
-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 @@ #include "backlight-target.h" #endif +#ifdef SIMULATOR +void __backlight_on(void) +{ + sim_backlight(100); +} + +static inline void __backlight_off(void) +{ + sim_backlight(0); +} +#else /* Basic low-level code that simply switches backlight on or off. Probably * a nice candidate for inclusion in the target/ dir. */ #ifndef TARGET_TREE static inline void __backlight_on(void) { -#ifdef SIMULATOR - sim_backlight(100); -#elif CONFIG_BACKLIGHT == BL_IRIVER_H100 +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 and_l(~0x00020000, &GPIO1_OUT); #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 lcd_enable(true); @@ -90,9 +99,7 @@ static inline void __backlight_on(void) static inline void __backlight_off(void) { -#ifdef SIMULATOR - sim_backlight(0); -#elif CONFIG_BACKLIGHT == BL_IRIVER_H100 +#if CONFIG_BACKLIGHT == BL_IRIVER_H100 or_l(0x00020000, &GPIO1_OUT); #elif CONFIG_BACKLIGHT == BL_IRIVER_H300 and_l(~0x00020000, &GPIO1_OUT); @@ -126,6 +133,7 @@ static inline void __backlight_off(void) #endif } #endif +#endif /* SIMULATOR */ #if defined(CONFIG_BACKLIGHT) && !defined(BOOTLOADER) |