summaryrefslogtreecommitdiff
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
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
-rw-r--r--firmware/SOURCES1
-rw-r--r--firmware/target/arm/as3525/sansa-clip/backlight-clip.c35
-rw-r--r--firmware/target/arm/as3525/sansa-clip/backlight-target.h19
3 files changed, 15 insertions, 40 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index fe141eb366..61e335c77f 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -1274,7 +1274,6 @@ target/arm/as3525/sansa-clipv2/lcd-as-clipv2.S
1274target/arm/as3525/lcd-ssd1303.c 1274target/arm/as3525/lcd-ssd1303.c
1275target/arm/as3525/sansa-clip/lcd-clip.c 1275target/arm/as3525/sansa-clip/lcd-clip.c
1276target/arm/as3525/sansa-clip/button-clip.c 1276target/arm/as3525/sansa-clip/button-clip.c
1277target/arm/as3525/sansa-clip/backlight-clip.c
1278#ifndef BOOTLOADER 1277#ifndef BOOTLOADER
1279target/arm/powermgmt-ascodec.c 1278target/arm/powermgmt-ascodec.c
1280target/arm/as3525/sansa-clip/powermgmt-clip.c 1279target/arm/as3525/sansa-clip/powermgmt-clip.c
diff --git a/firmware/target/arm/as3525/sansa-clip/backlight-clip.c b/firmware/target/arm/as3525/sansa-clip/backlight-clip.c
deleted file mode 100644
index d22b04b34e..0000000000
--- a/firmware/target/arm/as3525/sansa-clip/backlight-clip.c
+++ /dev/null
@@ -1,35 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright © 2008 Rafaël Carré
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#include "backlight-target.h"
23#include "as3525.h"
24
25void _buttonlight_on(void)
26{
27 GPIOD_DIR |= (1<<7);
28 GPIOD_PIN(7) = (1<<7); /* set pin d7 high */
29}
30
31void _buttonlight_off(void)
32{
33 GPIOD_DIR |= (1<<7);
34 GPIOD_PIN(7) = 0; /* set pin d7 low */
35}
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 @@
25#include "lcd.h" 25#include "lcd.h"
26#include "backlight.h" 26#include "backlight.h"
27 27
28#define _backlight_init() true
29
30static inline void _backlight_on(void) 28static inline void _backlight_on(void)
31{ 29{
32 lcd_enable(true); 30 lcd_enable(true);
@@ -37,7 +35,20 @@ static inline void _backlight_off(void)
37 lcd_enable(false); 35 lcd_enable(false);
38} 36}
39 37
40void _buttonlight_on(void); 38static inline bool _backlight_init(void)
41void _buttonlight_off(void); 39{
40 GPIOD_DIR |= (1<<7); /* for button light */
41 return true;
42}
43
44static inline void _buttonlight_on(void)
45{
46 GPIOD_PIN(7) = (1<<7);
47}
48
49static inline void _buttonlight_off(void)
50{
51 GPIOD_PIN(7) = 0;
52}
42 53
43#endif 54#endif