tslib移植總結

2021-06-02 10:01:30 字數 2158 閱讀 4032

**:

一編譯:

用的是ts1.0的版本

export cc=arm-linux-gcc

export path=/usr/local/arm/2.95.3/bin:$path

./autogen.sh

為防止出現undefined reference to `rpl_malloc' 錯誤,採取以下措施:

echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache

配置:./configure --host=arm-linux -cache-file=arm-linux.cache --prefix=/home/home/tslib/ts--enable-input=no

如果執行ts_calibrate時出現「ts_open: no such file or directory」 則需要加上 --enable-input=no

編譯make

安裝make install

複製生成的檔案到交叉編譯目錄下

cp ./build/lib/libts-0.0.so.0* /usr/local/arm/3.4.1/arm-linux/lib/

cp ./build/lib/libts.so /usr/local/arm/3.4.1/arm-linux/lib/

cp ./build/include/*.h /usr/local/arm/3.4.1/arm-linux/include/

觸控螢幕校正配置

支援觸控螢幕的tslib編譯完畢後,為了進行觸控螢幕校正,還需要設定環境變數並修改配置檔案/tslib-1.0/etc/ts.conf。

(1)設定環境變數

將tslib-1.0的整個目錄拷貝到開發板,然後修改/etc/profile檔案,在其中加入以下環境變數的設定:

vi ***/etc/profile                    # 其中***代表開發板上的根檔案系統目錄

export tslib_root=/tslib-1.0/build        # 指定tslib的安裝目錄

export tslib_tsdevice=/dev/input/event0  # 指定觸控螢幕裝置節點為event0

export tslib_calibfile=/etc/pointercal   #指定觸控螢幕校準檔案pointercal的存放位置

export tslib_conffile=$tslib_root/etc/ts.conf   # 指定tslib配置檔案的位置

export tslib_plugindir=$tslib_root/lib/ts   # 指定模組檔案

export tslib_consoledevice=none               # 控制台設為none

export tslib_fbdevice=/dev/fb0                # 指定幀快取裝置節點為fb0

export ld_library_path=$ld_library_path:$tslib_root/lib 

# 將tslib的庫檔案設為共享

(2)修改配置檔案

vi ***/tslib-1.0/build/etc/ts.conf

module_raw input                         #  指定輸入裝置

module pthres                             #  連續下壓

module variance delta=30             #  變化寬度

module dejitter delta=100            #  軌跡變化

module linear                           #  線性校準

其中第一行告訴tslib從linux的輸入裝置讀取資料,需要用到input這個模組,也就是plugin目錄下的input.so檔案;其他引數分別控制觸控點的連續下壓、變化寬度、軌跡變化和線性校準。

3.在開發板上進行測試校準

(1) 首先執行校準程式

./tslib_root/bin/ts _calibrate

共五點,分別為上左、上右、下左、下右和正中

(2)  然後執行測試程式

./tslib_root/bin/ts_test

參考:參考:configure -h

tslib 1 4 移植編譯總結

在linux下面解壓,建立make.sh 指令碼 export path hom bbb gcc linaro arm linux gnueabihf 4.8 2014.03 linux bin path export cross compile arm linux gnueabihf make c...

tslib 移植 相關整理

tslib的打補丁 編譯 安裝可參見博文 按照上文中的步驟編譯前,要注意先設定cc等環境變數,不然編譯完後執行時會出現.ts calibrate line 1 syntax error unexpected.這樣的錯誤。這一點上文中沒有強調,我就犯了這樣的錯誤。大概就是這幾項 export path...

tslib移植和測試

2.解壓 tar jxvf tslib 1.4.tar.bz 3.配置 cd tslib autogen.sh 如果出錯請看下面解決辦法 echo ac cv func malloc 0 nonnull yes arm linux.cache mkdir opt tslib 建立這個目錄是把qt安裝...