diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2010-05-20 10:13:14 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2010-05-20 10:13:14 +0000 |
commit | 2d0d08220f5357a1fb0d0fac775762027e756243 (patch) | |
tree | 25dfa5c80658180127a1bae683b0f74e5ed70157 | |
parent | 1102edb8f6a59d0e03bf635cc0a2918cf05589e6 (diff) | |
download | rockbox-2d0d08220f5357a1fb0d0fac775762027e756243.tar.gz rockbox-2d0d08220f5357a1fb0d0fac775762027e756243.zip |
HD200 - fix button readings afrer PLL settings change
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26186 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/adc-hd200.c | 8 | ||||
-rw-r--r-- | firmware/target/coldfire/mpio/hd200/system-hd200.c | 6 |
2 files changed, 7 insertions, 7 deletions
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) | |||
40 | { | 40 | { |
41 | static unsigned char channel IBSS_ATTR; | 41 | static unsigned char channel IBSS_ATTR; |
42 | /* read current value */ | 42 | /* read current value */ |
43 | adc_data[(channel & 0x03)] = ADVALUE; | 43 | adc_data[((channel&0x01)+1)] = ADVALUE; |
44 | 44 | ||
45 | /* switch channel | 45 | /* switch channel |
46 | * | 46 | * |
@@ -52,9 +52,9 @@ void ADC(void) | |||
52 | channel++; | 52 | channel++; |
53 | 53 | ||
54 | and_l(~(3<<24),&ADCONFIG); | 54 | and_l(~(3<<24),&ADCONFIG); |
55 | or_l( (((channel & 0x03) << 8 )|(1<<7))<<16, &ADCONFIG); | 55 | or_l( ((((channel&0x01)+1) << 8 )|(1<<7))<<16, &ADCONFIG); |
56 | 56 | ||
57 | if ( (channel & 0x03) == 0 ) | 57 | if ( (channel & 0x01) == 0 ) |
58 | /* disable ADC interrupt */ | 58 | /* disable ADC interrupt */ |
59 | and_l((~(1<<6))<<16,&ADCONFIG); | 59 | and_l((~(1<<6))<<16,&ADCONFIG); |
60 | } | 60 | } |
@@ -84,7 +84,7 @@ void adc_init(void) | |||
84 | * ADCLK_SEL = 011 (busclk/8) | 84 | * ADCLK_SEL = 011 (busclk/8) |
85 | */ | 85 | */ |
86 | 86 | ||
87 | ADCONFIG = (1<<10)|(1<<7)|(1<<1)|(1<<0); | 87 | ADCONFIG = (1<<10)|(1<<8)|(1<<7)|0x03; |
88 | 88 | ||
89 | /* ADC interrupt level 4.0 */ | 89 | /* ADC interrupt level 4.0 */ |
90 | or_l((4<<28), &INTPRI8); | 90 | or_l((4<<28), &INTPRI8); |
diff --git a/firmware/target/coldfire/mpio/hd200/system-hd200.c b/firmware/target/coldfire/mpio/hd200/system-hd200.c index beab29961d..2ebc5e8165 100644 --- a/firmware/target/coldfire/mpio/hd200/system-hd200.c +++ b/firmware/target/coldfire/mpio/hd200/system-hd200.c | |||
@@ -81,7 +81,7 @@ void cf_set_cpu_frequency(long frequency) | |||
81 | IDECONFIG2 = (1<<18)|(1<<16)|(1<<8)|(1<<0); /* TA /CS2 enable + CS2wait */ | 81 | IDECONFIG2 = (1<<18)|(1<<16)|(1<<8)|(1<<0); /* TA /CS2 enable + CS2wait */ |
82 | 82 | ||
83 | and_l(~(0x07<<16), &ADCONFIG); | 83 | and_l(~(0x07<<16), &ADCONFIG); |
84 | or_l(((1<<7)|(1<<2)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/32 */ | 84 | or_l((0x06)<<16, &ADCONFIG); /* adclk = busclk/64 */ |
85 | break; | 85 | break; |
86 | 86 | ||
87 | case CPUFREQ_NORMAL: | 87 | case CPUFREQ_NORMAL: |
@@ -101,7 +101,7 @@ void cf_set_cpu_frequency(long frequency) | |||
101 | IDECONFIG2 = (1<<18)|(1<<16); | 101 | IDECONFIG2 = (1<<18)|(1<<16); |
102 | 102 | ||
103 | and_l(~(0x07<<16), &ADCONFIG); | 103 | and_l(~(0x07<<16), &ADCONFIG); |
104 | or_l(((1<<7)|(1<<1)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/8 */ | 104 | or_l((0x03)<<16, &ADCONFIG); /* adclk = busclk/8 */ |
105 | break; | 105 | break; |
106 | 106 | ||
107 | default: | 107 | default: |
@@ -119,7 +119,7 @@ void cf_set_cpu_frequency(long frequency) | |||
119 | IDECONFIG2 = (1<<18)|(1<<16); | 119 | IDECONFIG2 = (1<<18)|(1<<16); |
120 | 120 | ||
121 | and_l(~(0x07<<16), &ADCONFIG); | 121 | and_l(~(0x07<<16), &ADCONFIG); |
122 | or_l(((1<<7)|(1<<0))<<16, &ADCONFIG); /* adclk = busclk/2 */ | 122 | or_l((0x01)<<16, &ADCONFIG); /* adclk = busclk/2 */ |
123 | break; | 123 | break; |
124 | } | 124 | } |
125 | } | 125 | } |