Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1721832
  • 博文数量: 199
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 6186
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-30 11:01
个人简介

Linuxer.

文章存档

2015年(4)

2014年(28)

2013年(167)

分类: LINUX

2013-06-03 09:53:24

tslib是触摸屏校准的库,这个是tslib源码,可以移植到嵌入式设备中对触摸屏进行校准在采用触摸屏的移动终端中,触摸屏性能的调试是个重要问题之一,因为电磁噪声的缘故,触摸屏容易存在点击不准确、有抖动等问题。
Tslib是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱动的适配层,为上层的应用提供了一个统一的接口。在Qtopia 4.*版本中,默认的Tslib版本为Tslib 1.4。在Qtopia 2.*版本中,默认的Tslib版本为Tslib 1.3

把 tslib1.4.tar.gz 文件放到 /tmp/ 目录下
1.解压缩:tar -zxvf tslib1.4.tar.gz
2.
运行./autogen.sh
3.运行./configure --prefix=/usr/local/tslib --host=arm-linux(这里不要改,是指运行平台) ac_cv_func_malloc_0_nonnull=yes
4.make
在make之前要修改/tests/ts_calibrate.c文件中的open函数的参数个数问题,如下:
5.make install,在虚拟机下的/usr/local/tslib/下生成触摸屏运行库。
6.编译过程出现的两个问题:
6.1.错误

Can't exec "libtoolize": No such file or directory at /usr/bin/autoreconf line 190.

Use of uninitialized value $libtoolize in pattern match (m//) at /usr/bin/autoreconf line 190.

configure.ac:25: error: possibly undefined macro: AC_DISABLE_STATIC

If this token and others are legitimate, please use m4_pattern_allow.

See the Autoconf documentation.

configure.ac:26: error: possibly undefined macro: AC_ENABLE_SHARED

configure.ac:27: error: possibly undefined macro: AC_LIBTOOL_DLOPEN

configure.ac:28: error: possibly undefined macro: AC_PROG_LIBTOOL

autoreconf: /usr/bin/autoconf failed with exit status: 1

解决方法:在ubuntu下安装libtool.deb或者更新用命令:apt-get install libtool

6.2在make时出错,提示
In function ‘open’,
inlined from ‘main’ at ts_calibrate.c:229:11:

/usr/include/bits/fcntl2.h:51:24: error: call to ‘__open_missing_mode’ declared with attribute error: open with O_CREAT in second argument needs 3 arguments
make[2]: *** [ts_calibrate.o] Error 1


解决方法:
这是因为open函数的语法不符合最新的gcc,在/tests/ts_calibrate.c中加入open的第三个参数0777:
if ((calfile = getenv("TSLIB_CALIBFILE")) != NULL) {
    cal_fd = open (calfile, O_CREAT | O_RDWR, 0777);
} else {
    cal_fd = open ("/etc/pointercal", O_CREAT | O_RDWR, 0777);
}

阅读(6943) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~