summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/sansa-clip/backlight-target.h
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-20 23:15:48 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-20 23:15:48 +0000
commit59462a8bf82aa453f09e85feb607555a582625f4 (patch)
tree90447b82e7da5564b9c25b8750044ba375baaf3d /firmware/target/arm/as3525/sansa-clip/backlight-target.h
parent427e871319510f3b271f4820a727613ba0eaf582 (diff)
downloadrockbox-59462a8bf82aa453f09e85feb607555a582625f4.tar.gz
rockbox-59462a8bf82aa453f09e85feb607555a582625f4.zip
Clipv1: move buttonlight functions to header
GPIO direction needs only to be set at init both functions are now one liners so make them static inline git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26218 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clip/backlight-target.h')
-rw-r--r--firmware/target/arm/as3525/sansa-clip/backlight-target.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/firmware/target/arm/as3525/sansa-clip/backlight-target.h b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
index 5a6ae34728..f836fb9ab2 100644
--- a/firmware/target/arm/as3525/sansa-clip/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clip/backlight-target.h
@@ -25,8 +25,6 @@
#include "lcd.h"
#include "backlight.h"
-#define _backlight_init() true
-
static inline void _backlight_on(void)
{
lcd_enable(true);
@@ -37,7 +35,20 @@ static inline void _backlight_off(void)
lcd_enable(false);
}
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+static inline bool _backlight_init(void)
+{
+ GPIOD_DIR |= (1<<7); /* for button light */
+ return true;
+}
+
+static inline void _buttonlight_on(void)
+{
+ GPIOD_PIN(7) = (1<<7);
+}
+
+static inline void _buttonlight_off(void)
+{
+ GPIOD_PIN(7) = 0;
+}
#endif