sudo apt-get install automake libtool autoconf
上面是我的微信和QQ群,欢迎新朋友的加入。
1.下载
我本地有一个包,直接用了,版本1.4
2.编译
sudo apt-get install automake libtool autoconf
sudo apt-get install autogen
./autogen.sh
./configure CC=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc CXX=/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ --prefix=/home/jun/i.mx6/code/15_tslib --host=arm-linux ac_cv_func_malloc_0_nonnull=yes
sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- install
编译成功
会在上一层目录生成相关文件
修改ts.conf
# Uncomment if you wish to use the linux input layer event interface
module_raw input
# Uncomment if you're using a Sharp Zaurus SL-5500/SL-5000d
# module_raw collie
# Uncomment if you're using a Sharp Zaurus SL-C700/C750/C760/C860
# module_raw corgi
# Uncomment if you're using a device with a UCB1200/1300/1400 TS interface
# module_raw ucb1x00
# Uncomment if you're using an HP iPaq h3600 or similar
# module_raw h3600
# Uncomment if you're using a Hitachi Webpad
# module_raw mk712
# Uncomment if you're using an IBM Arctic II
# module_raw arctic2
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
拷贝到文件系统
3.测试
检查TSLIB是否拷贝到板子
输入ts_然后tab键
输入vi /etc/profile
写入内容:
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
输入ts_test
看来移植是正常了,就是不能戳,因为配置没搞好
再打开vi /etc/profile
export TSLIB_TSDEVICE=/dev/input/touchscreen0
#export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
重启设备
4.几种问题的解决方案
1.Segmentation fault
ts.conf没修改,或者修改后前边的空格没有删除掉
vi /opt/ts.conf 最后内容如下:
module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear
a)、ts.conf文件中的各个设置选项之前不能有空格,否则会出现:Segmentation fault 错误,我就不小心在module…之前多了个空格,害我查了好久。
b)、 不要在pointercal对应的目录下,建立一个空的pointercal文件,否则在运行ts_calibrate时,也可能会出现Segmentation fault
2.ts_open: No such file or directory
导出触摸屏的环境变量:export TSLIB_TSDEVICE=/dev/input/event0
3.open tty:No such file or directory
KDSETMODE:Bad file descriptor
导出控制台环境变量:export TSLIB_CONSOLEDEVICE=none
4.Couldnt load module pthres
No raw modules loaded.
ts_config: Success
解决办法:
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
5.Couldnt open tslib config file: No such file or directory
ts_config: Illegalseek
解决办法:
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
6.No raw modules loaded.
Ts_config: No such file or directory
解决办法:
修改$T_ROOT/etc/ts.conf, 至少放开一个module_raw,并去掉前面空格
7.Couldnt load module pthres
No raw modules loaded.
ts_config: Success
解决办法:
#export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
5.再次测试
export TSLIB_TSDEVICE=/dev/input/event1
ts_test
触摸屏幕,会返回坐标信息
ts_calibrate
校准