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
This commit is contained in:
Peter D'Hoye 2007-08-21 23:37:26 +00:00
parent 496206be6e
commit 0d5451e7bd
2 changed files with 7 additions and 2 deletions

View file

@ -43,6 +43,11 @@ unsigned short adc_scan(int channel)
ADC_ADDR |= 0x20000000; ADC_ADDR |= 0x20000000;
ADC_ADDR |= 0x80000000; 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. /* 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 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. */ 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */

View file

@ -98,7 +98,7 @@ int button_read_device(void)
if ( GPIOD_INPUT_VAL & 0x20 ) if ( GPIOD_INPUT_VAL & 0x20 )
{ {
GPIOD_OUTPUT_VAL &=~ 0x40; GPIOD_OUTPUT_VAL &=~ 0x40;
udelay(50); udelay(250);
data = adc_scan(ADC_SCROLLPAD); data = adc_scan(ADC_SCROLLPAD);
GPIOD_OUTPUT_VAL |= 0x40; GPIOD_OUTPUT_VAL |= 0x40;