summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-01-11 04:51:24 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-01-11 04:51:24 +0000
commit6a73367ee69a252bc53332d8ed82be5921b9531c (patch)
tree0b02fa52e0c7c36762de5312a3f7230a50394a27
parentce703c85d9f0d353008b9519c195d63bd979c6b4 (diff)
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.c20
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 @@
static int int_btn = BUTTON_NONE;
#ifndef BOOTLOADER
+static bool hold_button_old = false;
+
void button_init_device(void)
{
/* The touchpad is powered on and initialized in power-sa9200.c
@@ -72,8 +74,10 @@ void button_int(void)
}
}
#else
-void button_init_device(void){}
-#endif /* bootloader */
+void button_init_device(void)
+{
+}
+#endif /* BOOTLOADER */
bool button_hold(void)
{
@@ -86,8 +90,18 @@ bool button_hold(void)
int button_read_device(void)
{
int btn = int_btn;
+ bool hold = !(GPIOL_INPUT_VAL & 0x40);
+
+#ifndef BOOTLOADER
+ /* Backlight hold handling */
+ if (hold != hold_button_old)
+ {
+ hold_button_old = hold;
+ backlight_hold_changed(hold);
+ }
+#endif
- if (button_hold())
+ if (hold)
return BUTTON_NONE;
if (!(GPIOB_INPUT_VAL & 0x20)) btn |= BUTTON_POWER;