/* qtopia 2.2.0 支持触摸屏.txt */
/* 2011-3-22 */
Kernel version :2.6.22.6
Crosstool :arm-linux-gcc-2.95.3
Board :FL2440
System :Ubuntu 10.10
Source :tslib-1.3.tar.bz2 , qtopia-free-2.2.0
一.修改qtopia-free-2.2.0:
在上一次 http://blog.csdn.net/ll_0520/archive/2011/01/07/6123187.aspx 的QT2移植基础上做如下修改然后重编译安装:
vi qtopia/src/qt/qconfig-qpe.h
取消注释:
#ifndef QT_NO_QWS_CURSOR
#define QT_NO_QWS_CURSOR
#endif
#ifndef QT_NO_QWS_MOUSE_AUTO
#define QT_NO_QWS_MOUSE_AUTO
#endif
#ifndef QT_NO_QWS_MOUSE_PC
#define QT_NO_QWS_MOUSE_PC
#endif
最后加上:
#define QT_QWS_IPAQ
#define QT_QWS_IPAQ_RAW
二.编译tslib-1.3.tar.bz2:
cd /home/arm/work/qt/source/
tar jxvf tslib-1.3.tar.bz2
apt-get install automake
export CC=/usr/local/arm/2.95.3/bin/arm-linux-gcc
export PATH=/usr/local/arm/2.95.3/bin:$PATH
./autogen.sh
echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache
./configure --host=arm-linux --target=arm-linux --prefix=$PWD/build --enable-static=yes --enable-shared=no
make
出错:
CODE:
libtool:link: only absolute run-paths are allowed
解决办法:要修改/tslib/plugins/Makefile里面找rpath
将LDFLAGS :=$(LDFLAGS) -rpath $(PLUGIN_DIR)
修改为:
LDFLAGS :=$(LDFLAGS) -rpath `cd $(PLUGIN_DIR) && pwd`
重新make
make install
当前文件夹下生成build文件夹:
安装tslib:
1. 所有库文件复制到单板/usr/lib目录
2. 所有ts_*可执行文件复制到单板/usb/bin目录下
3. ts.conf文件复制到单板/etc目录下
修改ts.conf,把dejitter那行去掉
我拷贝步骤如下:
cd build
cp bin/* /home/arm/rootfs/bin/
vi etc/ts.conf
把dejitter那行去掉
cp etc/ts.conf /home/arm/rootfs/etc/
cp lib/* /home/arm/rootfs/lib/rootfs/etc/
cp -r share/ /home/arm/rootfs/usr/
/* echo 8 > /proc/sys/kernel/printk //可以显示坐标值 */
新建qpe2_touch.sh,内容如下:
#!/bin/sh
export HOME=/usr/qpe2_touch
export QTDIR=/qtopia2_touch
export QPEDIR=/qtopia2_touch
export QWS_DISPLAY=LinuxFb:/dev/fb0
export PATH=$QPEDIR/bin:$PATH
export LD_LIBRARY_PATH=$QPEDIR/lib:$LD_LIBRARY_PATH
export QWS_KEYBOARD="TTY:/dev/tty1"
export QWS_MOUSE_PROTO=TPanel:/dev/ts0
ln -s /dev/ts0 /dev/h3600_tsraw
export TSLIB_TSDEVICE=/dev/h3600_tsraw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_TSEVENTTYPE="H3600"
$QPEDIR/bin/qpe &
启动内核后运行qpe2_touch.sh,经5点校准后触摸屏即可正常使用。
参考链接:
qtopia 2.2.0 支持触摸屏:
http://www.arm16.com/viewthread.php?tid=1049
QTOPIA2.2.0 触摸屏校正:
http://www.100ask.net/showtree.aspx?topicid=2485&postid=10968
工作笔记——Tslib的编译和触摸屏测试:
http://blogold.chinaunix.net/u1/33412/showart_282396.html