calibrate touch screen for gingerbread

597 views
Skip to first unread message

李晖

unread,
Apr 5, 2012, 11:58:10 AM4/5/12
to android...@googlegroups.com
hi, all
    I am porting android 2.3.7 to a ARM Cortex-A8 board, currently, the system can boot up, but the touch screen can not work correctly, when I slide left on the screen, the notification view show up, slide right, the notification view gone, slide up, the screen goes left, slide down, the screen goes right, did anyone came across this problem?
    BTW, I searched in the Internet and found that to calibrate the touchscreen, we can change the value in the system/etc/pointercal file which read by frameworks/base/services/java/com/android/services/InputDevice.java file, but there is no such file in the gingerbread source tree as the calibrate method has changed, did anyone knows how to calibrate the touch screen in android 2.3, thanks in advance!

andy
Best Regards
-------------------------------------------------------------------
-------------------------------------------------------------------
北京航空航天大学大学嵌入式系统实验室
新主楼G座1028室
李晖
MSN:lihui...@163.com

Alvin Wong

unread,
Apr 7, 2012, 6:05:19 AM4/7/12
to android-porting
Hi there,

I have ported (am porting) Gingerbread to my device and I made a
custom touchscreen 5-point calibration method. This is my port:
http://sourceforge.net/p/ipaq214android/android/ci/c01dc0839a8a86a74959f197ee99433da6805ead/tree/

==Relevant files==
InputReader.cpp.diff
InputReader.h.diff
ipaq214/wm97xx-touchscreen.idc

Files `InputReader.*.diff` are modifications to the framework to allow
using the 5-point calibration method by the idc file.
For the idc file you need to use the correct name. Some info is here:
http://source.android.com/tech/input/input-device-configuration-files.html
Note that lines 26-32 in `wm97xx-touchscreen.idc` is applicable only
for patched framework.
The idc file is copied to system/usr/idc in device.mk.

In order to use the calibration, you need to have an existing Linux
distribution that has TSLib built with it, calibrate it once, and get
the /etc/pointercal file after calibration. Then divide all the
numbers by the last number (should be 65536?) and replace line 27-32
of the idc file by the numbers.

The reason for me to use the idc file instead of etc/pointercal is
that I wanted to follow the standard. Obviously, using this method
isn't a really good way as calibration cannot be done dynamically.

For me, I used the "Pointer Location" in "Dev Tools" (ENG build) to
test the touchscreen pointer location.

I hope this helps.

Good luck,
Alvin Wong
> MSN:lihui205...@163.com
Reply all
Reply to author
Forward
0 new messages