From 0d5451e7bde8ed8babb96f22c98290a73411c26f Mon Sep 17 00:00:00 2001 From: Peter D'Hoye Date: Tue, 21 Aug 2007 23:37:26 +0000 Subject: H10: add more time between enabling touch-pad and reading ADC. Greatly improves touchpad stability. Add (and disable) checking for ADC done bit. Disabled because not yet working. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14419 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/iriver/h10/adc-h10.c | 7 ++++++- firmware/target/arm/iriver/h10/button-h10.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'firmware') diff --git a/firmware/target/arm/iriver/h10/adc-h10.c b/firmware/target/arm/iriver/h10/adc-h10.c index 8a4e24dd64..df9b16359b 100644 --- a/firmware/target/arm/iriver/h10/adc-h10.c +++ b/firmware/target/arm/iriver/h10/adc-h10.c @@ -42,7 +42,12 @@ unsigned short adc_scan(int channel) /* Start? */ ADC_ADDR |= 0x20000000; ADC_ADDR |= 0x80000000; - + +#if 0 + /* wait for ADC ready. THIS IS NOT WORKING (locks up) */ + while(ADC_STATUS & (0x40 << (channel*8))); /* add loop protection here */ +#endif + /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel. For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */ diff --git a/firmware/target/arm/iriver/h10/button-h10.c b/firmware/target/arm/iriver/h10/button-h10.c index 520a616b4c..d8a82cf170 100644 --- a/firmware/target/arm/iriver/h10/button-h10.c +++ b/firmware/target/arm/iriver/h10/button-h10.c @@ -98,7 +98,7 @@ int button_read_device(void) if ( GPIOD_INPUT_VAL & 0x20 ) { GPIOD_OUTPUT_VAL &=~ 0x40; - udelay(50); + udelay(250); data = adc_scan(ADC_SCROLLPAD); GPIOD_OUTPUT_VAL |= 0x40; -- cgit v1.2.3