HD200 - fix button readings afrer PLL settings change

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26186 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Marcin Bukat 2010-05-20 10:13:14 +00:00
parent 1102edb8f6
commit 2d0d08220f
2 changed files with 7 additions and 7 deletions

View file

@ -40,7 +40,7 @@ void ADC(void)
{
static unsigned char channel IBSS_ATTR;
/* read current value */
adc_data[(channel & 0x03)] = ADVALUE;
adc_data[((channel&0x01)+1)] = ADVALUE;
/* switch channel
*
@ -52,9 +52,9 @@ void ADC(void)
channel++;
and_l(~(3<<24),&ADCONFIG);
or_l( (((channel & 0x03) << 8 )|(1<<7))<<16, &ADCONFIG);
or_l( ((((channel&0x01)+1) << 8 )|(1<<7))<<16, &ADCONFIG);
if ( (channel & 0x03) == 0 )
if ( (channel & 0x01) == 0 )
/* disable ADC interrupt */
and_l((~(1<<6))<<16,&ADCONFIG);
}
@ -84,7 +84,7 @@ void adc_init(void)
* ADCLK_SEL = 011 (busclk/8)
*/
ADCONFIG = (1<<10)|(1<<7)|(1<<1)|(1<<0);
ADCONFIG = (1<<10)|(1<<8)|(1<<7)|0x03;
/* ADC interrupt level 4.0 */
or_l((4<<28), &INTPRI8);

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 */
and_l(~(0x07<<16), &ADCONFIG);
or_l(((1<<7)|(1<<2)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/32 */
or_l((0x06)<<16, &ADCONFIG); /* adclk = busclk/64 */
break;
case CPUFREQ_NORMAL:
@ -101,7 +101,7 @@ void cf_set_cpu_frequency(long frequency)
IDECONFIG2 = (1<<18)|(1<<16);
and_l(~(0x07<<16), &ADCONFIG);
or_l(((1<<7)|(1<<1)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/8 */
or_l((0x03)<<16, &ADCONFIG); /* adclk = busclk/8 */
break;
default:
@ -119,7 +119,7 @@ void cf_set_cpu_frequency(long frequency)
IDECONFIG2 = (1<<18)|(1<<16);
and_l(~(0x07<<16), &ADCONFIG);
or_l(((1<<7)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/2 */
or_l((0x01)<<16, &ADCONFIG); /* adclk = busclk/2 */
break;
}
}