mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-13 15:12:30 -05:00
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:
parent
496206be6e
commit
0d5451e7bd
2 changed files with 7 additions and 2 deletions
|
|
@ -43,6 +43,11 @@ unsigned short adc_scan(int channel)
|
|||
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. */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue