1
0
Fork 0
forked from len0rd/rockbox

Backlight brightness and button lights for the Philips HDD1630

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20035 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Mark Arigo 2009-02-18 02:19:22 +00:00
parent 42ef5b0c88
commit f34cd80f63
8 changed files with 156 additions and 93 deletions

View file

@ -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