From 3cdee0f09b677369a745bdb8098367b0946e29a1 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Tue, 6 Jul 2010 14:44:41 +0000 Subject: HD200 - Fix GPIO setup in button_init_device()- this change fixes sound output broken in r27258. Slightly adjust main buttons reading routine so key reading is more reliable with and without remote present git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27307 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/mpio/hd200/button-hd200.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/firmware/target/coldfire/mpio/hd200/button-hd200.c b/firmware/target/coldfire/mpio/hd200/button-hd200.c index fa0a5cf3cf..fba5c0b74e 100644 --- a/firmware/target/coldfire/mpio/hd200/button-hd200.c +++ b/firmware/target/coldfire/mpio/hd200/button-hd200.c @@ -37,12 +37,11 @@ static bool remote_detect(void) void button_init_device(void) { - /* GPIO56 (main PLAY) - * GPIO41 (remote PLAY) - * as general purpose inputs + /* GPIO56 (main PLAY) general input + * GPIO41 (remote PLAY) is shared with Audio Serial Data */ - or_l((1<<24)|(1<<9),&GPIO1_FUNCTION); - and_l(~((1<<24)|(1<<9)),&GPIO1_ENABLE); + or_l((1<<24),&GPIO1_FUNCTION); + and_l(~(1<<24),&GPIO1_ENABLE); } bool button_hold(void) @@ -92,7 +91,7 @@ int button_read_device(void) { data = adc_scan(ADC_BUTTONS); - if (data < 2250) /* valid button */ + if (data < 2300) /* valid button */ { if (data < 900) /* middle */ { @@ -121,7 +120,7 @@ int button_read_device(void) if (data < 1900) /* 1900 - 1600 */ btn = BUTTON_PREV; - else /* 1900 - 2250 */ + else /* 1900 - 2300 */ btn = BUTTON_SELECT; } } -- cgit v1.2.3