According to the previous article, the kernel is still unsuccessful after being burned. It is suspected that it is a problem of touch screen correction.
I tried the following method:
1. Search for information about the touch screen tutorial on the Internet and find the touch screen correction program written by netizens. However, if the program fails to be compiled using arm-eabi-gcc, stdio is missing. header files such as h may be arm-eabi-gcc;
2. Follow the Correction Algorithm in the tstest. c program: the second method also fails.
Although it fails, there are still some advantages. In the future, we can study the following time:
Sample_array [0]-[3]: topLeft, topRight, bottomLeft, and bottomRight. The following formula is used to calculate X1, X2, Y1, and Y2.
X1 = (sample_array [0]. x + sample_array [2]. x)/2;
X2 = (sample_array [1]. x + sample_array [3]. x)/2;
Y1 = (sample_array [0]. y + sample_array [1]. y)/2;
Y2 = (sample_array [2]. y + sample_array [3]. y)/2;
Pass:
DisX = 240-(240 * (value-X2)/(X1-X2); and disY = 320-(320 * (value-Y2)/(Y1-Y2); coordinate coordinates
Reference http://www.100ask.net/showtopic-1946.aspx
3. Follow the methods provided by netizens on the FriendlyArm Forum:
Http://www.arm9home.net/read.php? Tid-2406-fpage-0-toread--page-1.html
Http://www.arm9home.net/read.php? Tid-2517.html
The third method should be successful.
The details are as follows:
1. Add printk (KERN_INFO "X: % d, Y: % d/n", xp, yp) to touch_timer_fire to print the coordinates of four vertices;
2. The coordinates of the four printed vertices are: (xp, yp)
Top left (156,886)
Top right (0, 824,871)
Bottom left (149,141)
Bottom right (856,146)
3. Set
Input_set_abs_params (dev, ABS_X, 0, 0x3FF, 0, 0 );
Input_set_abs_params (dev, ABS_Y, 0, 0x3FF, 0, 0 );
Change
Input_set_abs_params (dev, ABS_X, 156,856, 0, 0 );
Input_set_abs_params (dev, ABS_Y, 146,886, 0, 0 );
(Note: TopLeft and BottomRight are used)
4. After rewriting by step 123, the kernel is burned in and the Y axis is reversed. Therefore, add: yp = yp-2 * (yp-(886 + 146) to touch_timer_fire) /2)
The y coordinate is symmetric relative to the midline of the y axis.
5. Re-compile the kernel, burn in 2440, and touch screen correction is successful.
But there are also some problems:
1. The accuracy of calibration is still very poor, especially when the X axis is close to the origin, and a grid is staggered;
2. the CPU and ram of mini2440 are not powerful enough (64 mb ram), and the SD card starts slowly;
3. It seems that there are no physical buttons. After Entering an application, the system will be suspended and press the touch screen to restart the application.
References:
1. How to analyze and correct the touch screen driver of friendlyarm:
Http://www.arm9home.net/read.php? Tid-2406-fpage-0-toread--page-1.html
Http://www.arm9home.net/read.php? Tid-2517.html
2. Another correction method (experiment failed on mini2440)
Http://www.100ask.net/showtopic-1946.aspx
3. douding net's article: the last few lines of key comments on touch screen correction are classic.
Http://www.docin.com/p-72516790.html
PS: the touch screen driver has just fallen. Next we will learn simple character drivers and Kernel configuration files. Come on!