移植tslib

原文链接: http://blog.csdn.net/zy812248258/article/details/42554139


首先下载tslib :   https://github.com/kergoth/tslib

1. 为了防止安装过程中出现错误,先执行命令: 

sudo apt-get install autoconf automake libtool

2. 解压源码, 进入源码文件夹

./autogen.sh

如果这一步出现错误, 很可能是因为第一步没有被执行, 在重新执行该命令之前需要先执行

./autogen-clean.sh

3. 配置

./configure --host=arm-linux-gnueabihf --prefix=/home/<user>/software/QT/tslib

第一项指明了交叉编译链, 第二项指明了安装路径, 注意安装路径千万不要和源码路径相同!

4. 

make

make install
执行完毕之后到安装目录下查看是否生成了 bin/  etc/ include/ lib/ 这四个文件夹

5. 进入 安装路径 下的 etc/  修改 etc/ts.conf, 将第二行的注释取消, 并保证行前没有空格

# Uncomment if you wish to use the linux input layer event interface
module_raw input

6. 将bin/、etc/、lib/三个目录分别拷贝到BBB的根目录下, 并修改配置信息 

sudo vi /etc/profile

export TSLIB_ROOT=/
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CALIBFILE=/etc/pointercal
export LD_LIBRARY_PATH=lib
export TSLIB_PLUGINDIR=/lib/ts

source /etc/profile 

注意:以上环境变量的名字不变,但是值可能需要根据自己的情况进行修改。比如开始我按照别人使用/dev/input/event0,结果运行程序出现selected device is not a touchscreen......如果不知道对应自己的触摸屏到底是哪一个,可以打开/dev/input下面发现by-path  event0  event1  mice  mouse0,运行cat event1,此时用手触摸屏幕,如果终端上传来数据,则说明event1就是你的触摸屏输入接口。


7. 运行 tslib_install / bin 下的 ts_calibrate , 如果看到屏幕上有校准提示, 则表示tslib移植成功. 










猜你喜欢

转载自blog.csdn.net/gongyuan073/article/details/46812231
今日推荐