summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/olympus/mrobe-100/button-mr100.c
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2009-02-18 02:19:22 +0000
committerMark Arigo <markarigo@gmail.com>2009-02-18 02:19:22 +0000
commitf34cd80f638a6ca3b336f6ebd14cd958974b2760 (patch)
tree91195848e098a6f0f6372d39424306e32d3df9d2 /firmware/target/arm/olympus/mrobe-100/button-mr100.c
parent42ef5b0c88f92418c79e7414063c808b7c36a9be (diff)
downloadrockbox-f34cd80f638a6ca3b336f6ebd14cd958974b2760.tar.gz
rockbox-f34cd80f638a6ca3b336f6ebd14cd958974b2760.zip
Backlight brightness and button lights for the Philips HDD1630
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20035 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/olympus/mrobe-100/button-mr100.c')
-rw-r--r--firmware/target/arm/olympus/mrobe-100/button-mr100.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/firmware/target/arm/olympus/mrobe-100/button-mr100.c b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
index 9cfd8affa9..130c32739a 100644
--- a/firmware/target/arm/olympus/mrobe-100/button-mr100.c
+++ b/firmware/target/arm/olympus/mrobe-100/button-mr100.c
@@ -35,8 +35,6 @@
static int int_btn = BUTTON_NONE;
#ifndef BOOTLOADER
-static int syn_status = 0;
-
void button_init_device(void)
{
/* enable touchpad leds */
@@ -58,21 +56,9 @@ void button_init_device(void)
GPIOD_OUTPUT_EN |= 0x4; /* DATA */
GPIOD_OUTPUT_VAL |= 0x4; /* high */
- if (syn_init())
+ if (!syn_init())
{
-#ifdef ROCKBOX_HAS_LOGF
- syn_info();
-#endif
-
- syn_status = 1;
-
- /* enable interrupts */
- GPIOD_INT_LEV &= ~0x2;
- GPIOD_INT_CLR |= 0x2;
- GPIOD_INT_EN |= 0x2;
-
- CPU_INT_EN |= HI_MASK;
- CPU_HI_INT_EN |= GPIO0_MASK;
+ logf("button_init_dev: touchpad not ready");
}
}
@@ -86,13 +72,12 @@ void button_int(void)
int_btn = BUTTON_NONE;
- if (syn_status)
+ if (syn_get_status())
{
/* disable interrupt while we read the touchpad */
- GPIOD_INT_EN &= ~0x2;
- GPIOD_INT_CLR |= 0x2;
+ syn_int_enable(false);
- val = syn_read_device(data, 4);
+ val = syn_read(data, 4);
if (val > 0)
{
val = data[0] & 0xff; /* packet header */
@@ -119,7 +104,7 @@ void button_int(void)
int_btn |= BUTTON_RIGHT;
/* An Absolute packet should follow which we ignore */
- val = syn_read_device(data, 4);
+ val = syn_read(data, 4);
logf(" int_btn = 0x%04x", int_btn);
}
@@ -148,8 +133,7 @@ void button_int(void)
}
/* re-enable interrupts */
- GPIOD_INT_LEV &= ~0x2;
- GPIOD_INT_EN |= 0x2;
+ syn_int_enable(true);
}
}
#else