linux的触摸屏之三:解析android平台上的tslib过程
(1)在tslib目录下有设置环境变量的文本文件:settsenv.sh,内容:
export T_ROOT=/system
export LD_LIBRARY_PATH=$T_ROOT/lib
export TSLIB_CONSOLEDEVICE=
export TSLIB_FBDEVICE=/dev/graphics/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/tslib/ts.conf
export TSLIB_CALIBFILE=/data/data/pointercal
设定的TSLIB的TS设备,FB设备,配置文件,动态库文件的路径。当然,具体的要用的可以在程序代码中重新设定。
(2)tslib目录下的etc目录ts.conf是配置文件,内容:
# Uncomment if you wish to use the linux input layer event interface
module_raw input1
# 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
可见,上面有很多模块可以调用,最终是选择了input1,也即是linux的input获取方式。这些模块的源代码在plugins目录下都有定义。
(3)分析流程,接触摸屏分析之一,在ts_main中:
void get_sample (struct tsdev *ts, calibration *cal, int index, int x, int y, char *name)
{
put_cross(x, y, 2 | XORMODE); //画十字座标
getxy (ts, &cal->x [index], &cal->y [index]); //取得x,y的LCD坐标值
put_cross(x, y, 2 | XORMODE);
last_x = cal->xfb [index] = x;
last_y = cal->yfb [index] = y; //赋值cal的触摸屏坐标
}
(4)解析getxy
struct ts_sample {
相关文档:
4、alarm和 setitimer系统调用
系统调用alarm的功能是设置一个定时器,当定时器计时到达时,将发出一个信号给进程。该调用的声明格式如下:
unsigned int alarm(unsigned int seconds);
&n ......
这几天我安装了一个Linux系统,想在里面学一下C语言的编写,发现在里面运行有一个好奇怪的现象:如下面
#include<stdio.h>
void mian(){
printf("hello world!");
}
输出没有结果!搞的我看了半天,程序没有错误啊!怎么这样!后来我把程序改为
#include<stdio.h>
void mian(){
printf("hello ......
linux共享库位置配置(LD_LIBRARY_PATH环境变量 或者 更改/etc/ld.so.conf 或者 使用-R选项)
2009-11-06
版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://skatings.blogbus.com/logs/50437681.html
linux共享库位置配置(LD_LIBRARY_PATH环境变量 或者 更改/etc/ld.so.conf 或者 使用-R选项) ......
Linux常用命令参考
1. diff
用于文件比较。一般file1是原文件,file2是新(修改过)的文件。
紧凑模式:diff -u file1 file2
diff -u file1 file2
--- file1 2010-03-06 02:11:43.000000000 +0000
+++ file2 2010-04-14 10:06:45.000000000 +0000
@@ -21,11 +21,9 @@
eeeeee
ffffff
2222 ......
cat awk '{print}'
cat -s awk '{blank = NF == 0 ? ++blan ......