summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-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