diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-07-06 14:44:41 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-07-06 14:44:41 +0000 |
commit | 3cdee0f09b677369a745bdb8098367b0946e29a1 (patch) | |
tree | 022a9c4ceb94e51b59745f6f5006f6a115bdc71d | |
parent | 7c908bbeda55d313a8c769d5d1faece2e33b3059 (diff) | |
download | rockbox-3cdee0f09b677369a745bdb8098367b0946e29a1.tar.gz rockbox-3cdee0f09b677369a745bdb8098367b0946e29a1.zip |
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
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/button-hd200.c | 13 |
1 files 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) | |||
37 | 37 | ||
38 | void button_init_device(void) | 38 | void button_init_device(void) |
39 | { | 39 | { |
40 | /* GPIO56 (main PLAY) | 40 | /* GPIO56 (main PLAY) general input |
41 | * GPIO41 (remote PLAY) | 41 | * GPIO41 (remote PLAY) is shared with Audio Serial Data |
42 | * as general purpose inputs | ||
43 | */ | 42 | */ |
44 | or_l((1<<24)|(1<<9),&GPIO1_FUNCTION); | 43 | or_l((1<<24),&GPIO1_FUNCTION); |
45 | and_l(~((1<<24)|(1<<9)),&GPIO1_ENABLE); | 44 | and_l(~(1<<24),&GPIO1_ENABLE); |
46 | } | 45 | } |
47 | 46 | ||
48 | bool button_hold(void) | 47 | bool button_hold(void) |
@@ -92,7 +91,7 @@ int button_read_device(void) | |||
92 | { | 91 | { |
93 | data = adc_scan(ADC_BUTTONS); | 92 | data = adc_scan(ADC_BUTTONS); |
94 | 93 | ||
95 | if (data < 2250) /* valid button */ | 94 | if (data < 2300) /* valid button */ |
96 | { | 95 | { |
97 | if (data < 900) /* middle */ | 96 | if (data < 900) /* middle */ |
98 | { | 97 | { |
@@ -121,7 +120,7 @@ int button_read_device(void) | |||
121 | if (data < 1900) | 120 | if (data < 1900) |
122 | /* 1900 - 1600 */ | 121 | /* 1900 - 1600 */ |
123 | btn = BUTTON_PREV; | 122 | btn = BUTTON_PREV; |
124 | else /* 1900 - 2250 */ | 123 | else /* 1900 - 2300 */ |
125 | btn = BUTTON_SELECT; | 124 | btn = BUTTON_SELECT; |
126 | } | 125 | } |
127 | } | 126 | } |