diff options
author | Dominik Wenger <domonoky@googlemail.com> | 2009-10-27 20:25:40 +0000 |
---|---|---|
committer | Dominik Wenger <domonoky@googlemail.com> | 2009-10-27 20:25:40 +0000 |
commit | 04ebf48fe4cb7bdd4d125e9e5f2507d03ede6a5b (patch) | |
tree | 0b3b501a59d9a774019d277b0947ee4194de0af4 /firmware/target/arm/s3c2440/adc-s3c2440.c | |
parent | 6f9724706f4df78a91f3bf9a10b50be109aac996 (diff) | |
download | rockbox-04ebf48fe4cb7bdd4d125e9e5f2507d03ede6a5b.tar.gz rockbox-04ebf48fe4cb7bdd4d125e9e5f2507d03ede6a5b.zip |
Initial touchscreen support for mini2440. Based on D2 touchscreen driver
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23370 a1c6a512-1295-4272-9138-f99709370657
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 | } |