summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-05-27 11:09:12 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-05-27 11:09:12 +0000
commit065ef89479e9149ed905ba4fb5efba71646c7c8d (patch)
tree4bed34dea877f52e4d25d601aa8037c4759ed927 /firmware/target
parent3cb30cb513d4697c72810eca34f78a0fa214789c (diff)
clipv2: make buttonlight functions static inline one-liners
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26323 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c12
-rw-r--r--firmware/target/arm/as3525/sansa-clipv2/backlight-target.h21
2 files changed, 18 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c b/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
index 05d9ffb7a2..bf28bd6108 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
+++ b/firmware/target/arm/as3525/sansa-clipv2/backlight-clipv2.c
@@ -35,15 +35,3 @@ void _backlight_off(void)
lcd_enable(false);
ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x0);
}
-
-void _buttonlight_on(void)
-{
- GPIOA_DIR |= (1<<5);
- GPIOA_PIN(5) = (1<<5); /* set pin a5 high */
-}
-
-void _buttonlight_off(void)
-{
- GPIOA_DIR |= (1<<5);
- GPIOA_PIN(5) = 0; /* set pin a5 low */
-}
diff --git a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
index d202408356..d8c013a64a 100644
--- a/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
+++ b/firmware/target/arm/as3525/sansa-clipv2/backlight-target.h
@@ -21,12 +21,27 @@
#ifndef BACKLIGHT_TARGET_H
#define BACKLIGHT_TARGET_H
-#define _backlight_init() true
+#include <stdbool.h>
+#include "cpu.h"
void _backlight_on(void);
void _backlight_off(void);
-void _buttonlight_on(void);
-void _buttonlight_off(void);
+static inline bool _backlight_init(void)
+{
+ GPIOA_DIR |= 1<<5; /* for button light */
+ return true;
+}
+
+static inline void _buttonlight_on(void)
+{
+ GPIOA_PIN(5) |= 1<<5;
+}
+
+static inline void _buttonlight_off(void)
+{
+ GPIOA_PIN(5) &= ~(1<<5);
+}
+
#endif