summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk/sansa-view/backlight-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/sandisk/sansa-view/backlight-view.c')
-rw-r--r--firmware/target/arm/sandisk/sansa-view/backlight-view.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/firmware/target/arm/sandisk/sansa-view/backlight-view.c b/firmware/target/arm/sandisk/sansa-view/backlight-view.c
index 20932c8607..d227016c35 100644
--- a/firmware/target/arm/sandisk/sansa-view/backlight-view.c
+++ b/firmware/target/arm/sandisk/sansa-view/backlight-view.c
@@ -8,6 +8,7 @@
8 * $Id$ 8 * $Id$
9 * 9 *
10 * Copyright (C) 2009 by Robert Keevil 10 * Copyright (C) 2009 by Robert Keevil
11 * Copyright (C) 2014 by Szymon Dziok
11 * 12 *
12 * This program is free software; you can redistribute it and/or 13 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License 14 * modify it under the terms of the GNU General Public License
@@ -31,20 +32,32 @@ void _backlight_set_brightness(int brightness)
31 32
32void _backlight_off(void) 33void _backlight_off(void)
33{ 34{
34 GPIO_SET_BITWISE(GPIOD_ENABLE, 1<<8); 35 GPIO_CLEAR_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
35} 36}
36 37
37void _backlight_on(void) 38void _backlight_on(void)
38{ 39{
39 GPIO_SET_BITWISE(GPIOD_ENABLE, 1); 40 GPIO_SET_BITWISE(GPIOD_OUTPUT_VAL, 0x01);
40} 41}
41 42
42void _buttonlight_on(void) 43void _buttonlight_on(void)
43{ 44{
44 GPIO_CLEAR_BITWISE(GPIOA_ENABLE, 0x2); 45 /* GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */
46 GPIO_SET_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */
47
48 GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */
49 GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */
50 GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */
51 GPIO_CLEAR_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */
45} 52}
46 53
47void _buttonlight_off(void) 54void _buttonlight_off(void)
48{ 55{
49 GPIO_SET_BITWISE(GPIOA_ENABLE, 0x2); 56 /* GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x02); */ /* vertical buttonlight */
57 GPIO_CLEAR_BITWISE(GPIOA_OUTPUT_VAL, 0x01); /* horizontal buttonlight */
58
59 GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x80); /* scrollwheel bottom led */
60 GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x40); /* scrollwheel right led */
61 GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x20); /* scrollwheel top led */
62 GPIO_SET_BITWISE(GPIOR_OUTPUT_VAL, 0x10); /* scrollwheel left led */
50} 63}