tslib移植和测试

1、下载tslib的源码:tslib1.4文件下载,本人测试可用

2.解压 # tar -jxvf tslib_1.4.tar.bz

3.配置

# cd tslib
# ./autogen.sh  //如果出错请看下面解决办法
# echo "ac_cv_func_malloc_0_nonnull=yes">arm-linux.cache 
# mkdir /opt/tslib      //创建这个目录是把qt安装到这里
# ./configure --prefix=/opt/tslib --host=arm-linux --cache-file=arm-linux.cache

./autogen.sh出错是缺少安装包:./autogen.sh: 4: autoreconf: not found
#sudo apt-get install autoconf automake libtool

4.编译和安装

# make
# make install   //就安装到/opt/tslib中了

5.部署

(1)动态库文件so
(2)配置文件
(3)bin文件
我们把以上三个都配置,部署上去 #cp /opt/tslib/ /home/aston/rootfs/rootfs/ -rf
然后再改名字为tslib1.4 #mv tslib tslib1.4来部署

6.导出环境变量

在开发板linux中执行# vi /etc/profile 添加

export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/tslib1.4/etc/pointercal  
// pointercal是校准之后生成的文件
export TSLIB_CONFFILE=/tslib1.4/etc/ts.conf
export TSLIB_PLUGINDIR=/tslib1.4/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tslib1.4/lib  //添加共享库
#export TS_INFO_FILE=/sys/class/input/input2/uevent
export TS_INFO_FILE=/sys/class/input/input1/uevent

7.运行和测试

在tslib1.4/bin文件中提供了测试用的ts_calibrate ts_harvest ts_print ts_print_raw ts_test等以供我们的测试
【出错】
(1) ts_config: No such file or directory
解决:在etc/ts.conf中打开module raw input这行的注释就行了。
(2) 这里写图片描述
解决:在内核的目录中,intput.h修改如下即可
这里写图片描述

也可以参考这个博客:https://blog.csdn.net/liuzijiang1123/article/details/45787901

猜你喜欢

转载自blog.csdn.net/m0_37182543/article/details/80285630