1
0
Fork 0
forked from len0rd/rockbox

HD200 - Increase ADC clock when boosted. Scan all 4 ADC channels during system tick

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27262 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Marcin Bukat 2010-07-03 21:44:49 +00:00
parent 64276fc0ff
commit 6e40988803
2 changed files with 5 additions and 5 deletions

View file

@ -40,7 +40,7 @@ void ADC(void)
{ {
static unsigned char channel IBSS_ATTR; static unsigned char channel IBSS_ATTR;
/* read current value */ /* read current value */
adc_data[((channel&0x01)+1)] = ADVALUE; adc_data[(channel&0x03)] = ADVALUE;
/* switch channel /* switch channel
* *
@ -51,10 +51,10 @@ void ADC(void)
channel++; channel++;
and_l(~(3<<24),&ADCONFIG); and_l(~(0x03<<24),&ADCONFIG);
or_l( ((((channel&0x01)+1) << 8 )|(1<<7))<<16, &ADCONFIG); or_l( (((channel&0x03) << 8 )|(1<<7))<<16, &ADCONFIG);
if ( (channel & 0x01) == 0 ) if ( (channel & 0x03) == 0 )
/* disable ADC interrupt */ /* disable ADC interrupt */
and_l((~(1<<6))<<16,&ADCONFIG); and_l((~(1<<6))<<16,&ADCONFIG);
} }

View file

@ -81,7 +81,7 @@ void cf_set_cpu_frequency(long frequency)
IDECONFIG2 = (1<<18)|(1<<16)|(1<<8)|(1<<0); /* TA /CS2 enable + CS2wait */ IDECONFIG2 = (1<<18)|(1<<16)|(1<<8)|(1<<0); /* TA /CS2 enable + CS2wait */
and_l(~(0x07<<16), &ADCONFIG); and_l(~(0x07<<16), &ADCONFIG);
or_l((0x06)<<16, &ADCONFIG); /* adclk = busclk/64 */ or_l((0x05)<<16, &ADCONFIG); /* adclk = busclk/32 */
break; break;
case CPUFREQ_NORMAL: case CPUFREQ_NORMAL: