diff options
Diffstat (limited to 'firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c')
-rw-r--r-- | firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c index 758aa875cc..589f80436e 100644 --- a/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c +++ b/firmware/target/arm/as3525/sansa-clipzip/backlight-clipzip.c | |||
@@ -25,11 +25,14 @@ | |||
25 | #include "lcd.h" | 25 | #include "lcd.h" |
26 | #include "as3525v2.h" | 26 | #include "as3525v2.h" |
27 | #include "ascodec-target.h" | 27 | #include "ascodec-target.h" |
28 | #include "lcd-target.h" | ||
28 | 29 | ||
29 | bool _backlight_init() | 30 | bool _backlight_init() |
30 | { | 31 | { |
31 | /* GPIO B1 controls backlight */ | 32 | /* GPIO B1 controls backlight */ |
32 | GPIOB_DIR |= (1 << 1); | 33 | GPIOB_DIR |= (1 << 1); |
34 | ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); | ||
35 | GPIOB_PIN(1) = (1 << 1); | ||
33 | 36 | ||
34 | return true; | 37 | return true; |
35 | } | 38 | } |
@@ -37,13 +40,6 @@ bool _backlight_init() | |||
37 | void _backlight_on(void) | 40 | void _backlight_on(void) |
38 | { | 41 | { |
39 | GPIOB_PIN(1) = (1 << 1); | 42 | GPIOB_PIN(1) = (1 << 1); |
40 | |||
41 | ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); | ||
42 | sleep(1); | ||
43 | ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); | ||
44 | sleep(1); | ||
45 | ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); | ||
46 | |||
47 | #ifdef HAVE_LCD_ENABLE | 43 | #ifdef HAVE_LCD_ENABLE |
48 | lcd_enable(true); | 44 | lcd_enable(true); |
49 | #endif | 45 | #endif |
@@ -54,9 +50,11 @@ void _backlight_off(void) | |||
54 | #ifdef HAVE_LCD_ENABLE | 50 | #ifdef HAVE_LCD_ENABLE |
55 | lcd_enable(false); | 51 | lcd_enable(false); |
56 | #endif | 52 | #endif |
57 | |||
58 | GPIOB_PIN(1) = 0; | 53 | GPIOB_PIN(1) = 0; |
59 | 54 | } | |
60 | ascodec_write_pmu(AS3543_BACKLIGHT, 1, 0x91); | 55 | |
56 | void _backlight_set_brightness(int brightness) | ||
57 | { | ||
58 | oled_brightness(brightness); | ||
61 | } | 59 | } |
62 | 60 | ||