summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-yps3.h6
-rw-r--r--firmware/target/arm/s5l8700/yps3/backlight-yps3.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/firmware/export/config-yps3.h b/firmware/export/config-yps3.h
index 2685f0228a..a1485eadad 100644
--- a/firmware/export/config-yps3.h
+++ b/firmware/export/config-yps3.h
@@ -72,8 +72,14 @@
72 should be defined as well. */ 72 should be defined as well. */
73//#define HAVE_LCD_SLEEP 73//#define HAVE_LCD_SLEEP
74 74
75/* We have button lights */
76#define HAVE_BUTTON_LIGHT
77
75#define CONFIG_KEYPAD MEIZU_M3_PAD 78#define CONFIG_KEYPAD MEIZU_M3_PAD
76 79
80/* We have headphone detection */
81#define HAVE_HEADPHONE_DETECTION
82
77//#define AB_REPEAT_ENABLE 1 83//#define AB_REPEAT_ENABLE 1
78//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE 84//#define ACTION_WPSAB_SINGLE ACTION_WPS_BROWSE
79 85
diff --git a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
index 0a9cf3cc9a..7fda82a29c 100644
--- a/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
+++ b/firmware/target/arm/s5l8700/yps3/backlight-yps3.c
@@ -30,6 +30,9 @@
30 30
31 The PWM duty cycle depends exponentially on the configured brightness 31 The PWM duty cycle depends exponentially on the configured brightness
32 level. This makes the brightness curve more linear to the human eye. 32 level. This makes the brightness curve more linear to the human eye.
33
34 The button LEDs are all activated at the same time (even though there
35 are three individually controllable groups: menu/back, cursor, middle).
33 */ 36 */
34 37
35void _backlight_set_brightness(int brightness) 38void _backlight_set_brightness(int brightness)
@@ -52,8 +55,24 @@ void _backlight_off(void)
52 _backlight_set_brightness(MIN_BRIGHTNESS_SETTING); 55 _backlight_set_brightness(MIN_BRIGHTNESS_SETTING);
53} 56}
54 57
58void _buttonlight_on(void)
59{
60 PDAT3 |= (3 << 2);
61 PDAT4 |= (1 << 2);
62}
63
64void _buttonlight_off(void)
65{
66 PDAT3 &= ~(3 << 2);
67 PDAT4 &= ~(1 << 2);
68}
69
55bool _backlight_init(void) 70bool _backlight_init(void)
56{ 71{
72 /* Enable button LEDs: P3.2 (menu/back), P3.3 (cursor), P4.2 (middle) */
73 PCON3 = (PCON3 & ~0x0000FF00) | 0x00001100;
74 PCON4 = (PCON4 & ~0x00000F00) | 0x00000100;
75
57 /* enable backlight pin as timer output */ 76 /* enable backlight pin as timer output */
58 PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0)); 77 PCON0 = ((PCON0 & ~(3 << 0)) | (2 << 0));
59 78