linux tslib-1.4移植

来源:互联网 发布:ember.js form表单 编辑:程序博客网 时间:2024/04/29 03:37

1、下载tslib-1.4.tar.gz:

http://download.csdn.net/source/3177449

2、解压安装tslib:

# tar -zxvf tslib-1.4.tar.gz

# cd tslib

# ./autogen.sh
# echo "ac_cv_func_malloc_0_nonnull=yes" > arm-none-linux-gnueabi.cache

# ./configure --host=arm-none-linux-gnueabi --cache-file=arm-none-linux-gnueabi.cache --prefix=/usr/local/tslib

# make

# sudo make install

3、修改ts.conf内容:
# vi /usr/local/tslib/etc/ts.conf

module_raw input
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

然后将整个tslib文件夹,下载到开发板的对应路径下(/usr/local)。

4、开发板配置环境变量:

通过超级终端,# vi /etc/profile

添加如下内容(绿色):

export TSLIB_ROOT=/usr/local/tslib 

export TSLIB_TSDEVICE=/dev/input/event0 #指定触屏设备

export TSLIB_CALIBFILE=/etc/pointercal #指定触摸屏校准文件 pintercal 的存放位置

export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf  #指定 TSLIB 配置文件的位置
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts   #指定触摸屏插件所在路径

export TSLIB_FBDEVICE=/dev/fb0     #指定帧缓冲设备 

export TSLIB_CONSOLEDEVICE=none    #设定控制台设备为 none ,否则默认为 /dev/tty ,这样可以避免出open consoledevice: No such file or directory KDSETMODE: Bad file descriptor  的错误

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$TSLIB_ROOT/lib


另外,要确保在/dev/input/目录下有event0设备文件,在/dev/目录下有fb0设备文件,如果没有,在执行下面./ts_calibrate 的时候,会报出“open *: No such file or directory ”的错误,这时,我们需要手动创建设备文件:

# mknod /dev/input/event0 c 13 64
# mknod /dev/fb0 c 29 0

5、执行测试命令:

重启开发板,在 /usr/local/tslib/bin 目录下,输入./ts_calibrate,出现tslib的触摸屏五点校准画面,至此,tslib的安装移植成功完成。


tslib 安装出错及解决

1.执行./autogen.sh

提示错误:

./autogen.sh: 4: autoreconf: not found

解决方法:

sudo apt-get install autoconf automake libtool 

2.执行./configure --host=arm-Linux --prefix=/usr/local/tslib

提示错误:

ts_test.o(.text+0x218): In function `main':
: undefined reference to `rpl_malloc'
fbutils.o(.text+0x234): In function `open_framebuffer':
: undefined reference to `rpl_malloc'
collect2: ld returned 1 exit status
make[2]: *** [ts_test] Error 1
make[2]: Leaving directory `/home/gfpeak/Desktop/tslib/tests'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/gfpeak/Desktop/tslib'

make: *** [all] Error 2 

解决方法:

在编译的时候 ./configure 后面的参数没有设置对,正确设置如下:
./configure --prefix=/usr/local/tslib/ --host=arm-linux ac_cv_func_malloc_0_nonnull=yes 

3. 执行 make 出错

error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments

解决方法:

修改cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR ,0)(据说是交叉编译器版本问题)

4. 编译 QT 时报错找不到 tslib 库

交叉编译器是 arm-none-linux-gnu-eabi 4.2.0

The tslib functionality test failed!(已指定了I和L参数), 进入tslib/bin下 file 发现编译生成的是x86版本,遂将 --host 改为arm-none-linux-gnueabi,生成了arm版本(此时configure不再报错)

5. 在开发板上运行校正程序时出现 No raw modules loaded

解决方法

把 tslib/etc 目录下的 ts.conf 的 "#module_raw input"的注释符号"#"去掉。但记住不要在前面留有空格 ,否则还会出现错误。



原文地址:

http://blog.chinaunix.net/uid-12461657-id-2975918.html

http://blog.csdn.net/lwbeyond/article/details/7694749

0 0
原创粉丝点击