From 201574d689b9144382bf9dfeb8fbce0565391e86 Mon Sep 17 00:00:00 2001 From: Szymon Dziok Date: Sun, 11 Sep 2011 12:21:01 +0000 Subject: HDD6330: Fix random issues with the button light (MENU button sometimes does not light up). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30505 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/synaptics-mep.c | 13 +++++++++++-- firmware/target/arm/philips/hdd6330/backlight-hdd6330.c | 12 ++++++------ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/firmware/drivers/synaptics-mep.c b/firmware/drivers/synaptics-mep.c index 98c8829ead..48139534f2 100644 --- a/firmware/drivers/synaptics-mep.c +++ b/firmware/drivers/synaptics-mep.c @@ -590,7 +590,7 @@ int touchpad_read_device(char *data, int len) int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param) { char data[4]; - int val=0; + int i, val=0; if (syn_status) { @@ -601,7 +601,16 @@ int touchpad_set_parameter(char mod_nr, char par_nr, unsigned int param) data[2]=(param >> 8) & 0xff; /* param_hi */ data[3]=param & 0xff; /* param_lo */ syn_send(data,4); - val=syn_read(data,1); /* get the simple ACK = 0x18 */ + val=syn_read(data,4); /* try to get the simple ACK = 0x18 */ + + /* modules > 0 sometimes don't give ACK immediately but other packets like */ + /* absolute from the scroll strip, so it has to be ignored until we receive ACK */ + if ((mod_nr > 0) && ((data[0] & 7) != 0)) + for (i = 0; i < 2; i++) + { + val=syn_read(data,4); + if (data[0] == 0x18) break; + } syn_enable_int(true); } diff --git a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c index 369f3a40f1..ec77e9c828 100644 --- a/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c +++ b/firmware/target/arm/philips/hdd6330/backlight-hdd6330.c @@ -55,26 +55,26 @@ void _buttonlight_on(void) { if (!buttonlight_status) { + /* enable 1 led (from 2) for MENU - GPO, module 1 */ + /* no need to enable led for the hidden button */ + touchpad_set_parameter(0x01,0x21,0x01); /* enable 3 leds (from 5) for PREV, PLAY and NEXT, */ /* skip 2 leds because their light does not pass */ /* through the panel anyway - on GPOs, module 0 */ touchpad_set_parameter(0x00,0x22,0x15); - /* enable 1 led (from 2) for MENU - GPO, module 1 */ - /* no need to enable led for the hidden button */ - touchpad_set_parameter(0x01,0x21,0x01); /* left, right and the scrollstrip */ touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness); buttonlight_status = 1; } } - + void _buttonlight_off(void) { if (buttonlight_status) { /* disable all leds on GPOs for module 0 and 1 */ - touchpad_set_parameter(0x00,0x22,0x00); touchpad_set_parameter(0x01,0x21,0x00); + touchpad_set_parameter(0x00,0x22,0x00); touchpad_set_buttonlights(BUTTONLIGHT_MASK, 0); buttonlight_status = 0; } @@ -82,8 +82,8 @@ void _buttonlight_off(void) void _buttonlight_set_brightness(int brightness) { - touchpad_set_parameter(0x00,0x22,0x15); touchpad_set_parameter(0x01,0x21,0x01); + touchpad_set_parameter(0x00,0x22,0x15); buttonight_brightness = brightness - 1; touchpad_set_buttonlights(BUTTONLIGHT_MASK, buttonight_brightness); buttonlight_status = 1; -- cgit v1.2.3