From 04ebf48fe4cb7bdd4d125e9e5f2507d03ede6a5b Mon Sep 17 00:00:00 2001 From: Dominik Wenger Date: Tue, 27 Oct 2009 20:25:40 +0000 Subject: 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 --- firmware/target/arm/s3c2440/adc-s3c2440.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'firmware/target/arm/s3c2440/adc-s3c2440.c') 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 @@ #include "adc-target.h" #include "kernel.h" +#ifdef MINI2440 +#include "touchscreen-target.h" +#endif + static unsigned short adc_readings[NUM_ADC_CHANNELS]; /* prototypes */ @@ -122,7 +126,7 @@ static unsigned short __adc_read(int channel) /* add this to the tick so that the ADC converts are done in the background */ static void adc_tick(void) { - static unsigned channel; + static unsigned channel=0; /* Check if the End Of Conversion is set */ if (ADCCON & (1<<15)) @@ -132,7 +136,10 @@ static void adc_tick(void) { channel = 0; } - +#ifdef MINI2440 + /* interleave a touchscreen read if neccessary */ + touchscreen_scan_device(); +#endif /* setup the next conversion and start it*/ ADCCON = (ADCCON & ~(0x7<<3)) | (channel<<3) | 0x01; } -- cgit v1.2.3