From 2d0d08220f5357a1fb0d0fac775762027e756243 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Thu, 20 May 2010 10:13:14 +0000 Subject: HD200 - fix button readings afrer PLL settings change git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26186 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/coldfire/mpio/hd200/adc-hd200.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'firmware/target/coldfire/mpio/hd200/adc-hd200.c') diff --git a/firmware/target/coldfire/mpio/hd200/adc-hd200.c b/firmware/target/coldfire/mpio/hd200/adc-hd200.c index 3e162a2251..656d82e721 100644 --- a/firmware/target/coldfire/mpio/hd200/adc-hd200.c +++ b/firmware/target/coldfire/mpio/hd200/adc-hd200.c @@ -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); -- cgit v1.2.3