libts 1.4在SkyEye 1.3.1 + Arm Linux 2.6.36上的移植

1. 下载kergoth-tslib-1.0-0-gd7f5dae.zip,地址为 http://download.github.com/kergoth-tslib-1.0-0-gd7f5dae.zip

2. 执行下面脚本:
unzip kergoth-tslib-1.0-0-gd7f5dae.zip
cd kergoth-tslib-d7f5dae/

3. gedit src/ts_read_raw.c &
    将函数ts_read_raw中的:
    return result;
    修改成:
    return (result > 0);

4. gedit tests/testutils.c &
    将函数getxy中的:
    struct ts_sample samp[MAX_SAMPLES];
    修改成:
    struct ts_sample samp[MAX_SAMPLES] = {0};

5. 执行下面脚本:
sudo apt-get install libtool
./autogen.sh
./configure -prefix=/opt/tslib/ -host=arm-linux ac_cv_func_malloc_0_nonnull=yes
make
sudo make install

至此,安装完成。板子上需要做一些设置,首先进入板子根目录,然后执行下面脚本:

mkdir -p opt/tslib
mkdir -p opt/tslib/bin
cp /opt/tslib/bin/ts_calibrate /opt/tslib/bin/ts_test opt/tslib/bin/
arm-linux-strip opt/tslib/bin/ts_calibrate opt/tslib/bin/ts_test
mkdir -p opt/tslib/lib/ts
cp /opt/tslib/lib/libts-* opt/tslib/lib/
cp /opt/tslib/lib/ts/h3600.so /opt/tslib/lib/ts/pthres.so /opt/tslib/lib/ts/variance.so /opt/tslib/lib/ts/dejitter.so /opt/tslib/lib/ts/linear.so opt/tslib/lib/ts/
arm-linux-strip opt/tslib/lib/libts-0.0.so.0 opt/tslib/lib/libts-0.0.so.0.1.1 opt/tslib/lib/ts/h3600.so opt/tslib/lib/ts/pthres.so opt/tslib/lib/ts/variance.so opt/tslib/lib/ts/dejitter.so opt/tslib/lib/ts/linear.so
mkdir -p opt/tslib/etc

gedit opt/tslib/etc/ts.conf &
输入以下内容:
module_raw h3600
module pthres pmin=1
module variance delta=30
module dejitter delta=100
module linear

gedit etc/init.d/rcS &
添加以下内容内容:
export TSLIB_TSDEVICE=/dev/ts
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CONSOLEDEVICE=none
export TSLIB_CALIBFILE=/etc/pointercal
export T_ROOT=/opt/tslib
export TSLIB_PLUGINDIR=$T_ROOT/lib/ts
export TSLIB_CONFFILE=$T_ROOT/etc/ts.conf
export PATH=$T_ROOT/bin:$PATH
export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR/lib

注意确保文件etc/pointercal不存在,并且不是目录,否则会出现Segmentation fault。

你可能感兴趣的:(libts 1.4在SkyEye 1.3.1 + Arm Linux 2.6.36上的移植)