diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2011-01-11 04:51:24 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2011-01-11 04:51:24 +0000 |
commit | 6a73367ee69a252bc53332d8ed82be5921b9531c (patch) | |
tree | 0b02fa52e0c7c36762de5312a3f7230a50394a27 | |
parent | ce703c85d9f0d353008b9519c195d63bd979c6b4 (diff) | |
download | rockbox-6a73367ee69a252bc53332d8ed82be5921b9531c.tar.gz rockbox-6a73367ee69a252bc53332d8ed82be5921b9531c.zip |
SA9200: Implement the backlight hold handling.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29030 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/arm/philips/sa9200/button-sa9200.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/firmware/target/arm/philips/sa9200/button-sa9200.c b/firmware/target/arm/philips/sa9200/button-sa9200.c index 9fab3d4068..e3d569f422 100644 --- a/firmware/target/arm/philips/sa9200/button-sa9200.c +++ b/firmware/target/arm/philips/sa9200/button-sa9200.c | |||
@@ -30,6 +30,8 @@ | |||
30 | static int int_btn = BUTTON_NONE; | 30 | static int int_btn = BUTTON_NONE; |
31 | 31 | ||
32 | #ifndef BOOTLOADER | 32 | #ifndef BOOTLOADER |
33 | static bool hold_button_old = false; | ||
34 | |||
33 | void button_init_device(void) | 35 | void button_init_device(void) |
34 | { | 36 | { |
35 | /* The touchpad is powered on and initialized in power-sa9200.c | 37 | /* The touchpad is powered on and initialized in power-sa9200.c |
@@ -72,8 +74,10 @@ void button_int(void) | |||
72 | } | 74 | } |
73 | } | 75 | } |
74 | #else | 76 | #else |
75 | void button_init_device(void){} | 77 | void button_init_device(void) |
76 | #endif /* bootloader */ | 78 | { |
79 | } | ||
80 | #endif /* BOOTLOADER */ | ||
77 | 81 | ||
78 | bool button_hold(void) | 82 | bool button_hold(void) |
79 | { | 83 | { |
@@ -86,8 +90,18 @@ bool button_hold(void) | |||
86 | int button_read_device(void) | 90 | int button_read_device(void) |
87 | { | 91 | { |
88 | int btn = int_btn; | 92 | int btn = int_btn; |
93 | bool hold = !(GPIOL_INPUT_VAL & 0x40); | ||
94 | |||
95 | #ifndef BOOTLOADER | ||
96 | /* Backlight hold handling */ | ||
97 | if (hold != hold_button_old) | ||
98 | { | ||
99 | hold_button_old = hold; | ||
100 | backlight_hold_changed(hold); | ||
101 | } | ||
102 | #endif | ||
89 | 103 | ||
90 | if (button_hold()) | 104 | if (hold) |
91 | return BUTTON_NONE; | 105 | return BUTTON_NONE; |
92 | 106 | ||
93 | if (!(GPIOB_INPUT_VAL & 0x20)) btn |= BUTTON_POWER; | 107 | if (!(GPIOB_INPUT_VAL & 0x20)) btn |= BUTTON_POWER; |