summaryrefslogtreecommitdiff
path: root/firmware/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/backlight.c')
-rw-r--r--firmware/backlight.c20
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)