diff options
Diffstat (limited to 'firmware/target/arm/s3c2440/adc-s3c2440.c')
-rw-r--r-- | firmware/target/arm/s3c2440/adc-s3c2440.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/firmware/target/arm/s3c2440/adc-s3c2440.c b/firmware/target/arm/s3c2440/adc-s3c2440.c index fd5151a3bf..f42a3d2b6a 100644 --- a/firmware/target/arm/s3c2440/adc-s3c2440.c +++ b/firmware/target/arm/s3c2440/adc-s3c2440.c | |||
@@ -24,6 +24,10 @@ | |||
24 | #include "adc-target.h" | 24 | #include "adc-target.h" |
25 | #include "kernel.h" | 25 | #include "kernel.h" |
26 | 26 | ||
27 | #ifdef MINI2440 | ||
28 | #include "touchscreen-target.h" | ||
29 | #endif | ||
30 | |||
27 | static unsigned short adc_readings[NUM_ADC_CHANNELS]; | 31 | static unsigned short adc_readings[NUM_ADC_CHANNELS]; |
28 | 32 | ||
29 | /* prototypes */ | 33 | /* prototypes */ |
@@ -122,7 +126,7 @@ static unsigned short __adc_read(int channel) | |||
122 | /* add this to the tick so that the ADC converts are done in the background */ | 126 | /* add this to the tick so that the ADC converts are done in the background */ |
123 | static void adc_tick(void) | 127 | static void adc_tick(void) |
124 | { | 128 | { |
125 | static unsigned channel; | 129 | static unsigned channel=0; |
126 | 130 | ||
127 | /* Check if the End Of Conversion is set */ | 131 | /* Check if the End Of Conversion is set */ |
128 | if (ADCCON & (1<<15)) | 132 | if (ADCCON & (1<<15)) |
@@ -132,7 +136,10 @@ static void adc_tick(void) | |||
132 | { | 136 | { |
133 | channel = 0; | 137 | channel = 0; |
134 | } | 138 | } |
135 | 139 | #ifdef MINI2440 | |
140 | /* interleave a touchscreen read if neccessary */ | ||
141 | touchscreen_scan_device(); | ||
142 | #endif | ||
136 | /* setup the next conversion and start it*/ | 143 | /* setup the next conversion and start it*/ |
137 | ADCCON = (ADCCON & ~(0x7<<3)) | (channel<<3) | 0x01; | 144 | ADCCON = (ADCCON & ~(0x7<<3)) | (channel<<3) | 0x01; |
138 | } | 145 | } |