tslib移植中環境變量編輯

(1)將/usr/local/tslib下的全部文件複製到移植系統文件中/usr/local
(2)編輯移植系統中/etc/profile添加觸摸屏支持內容:
在/etc/profile文件中設置tslib環境變量:
# 指定tslib主目錄位置
export TSLIB_ROOT=/home/system/tslib
# 指定觸摸屏設備
export TSLIB_TSDEVICE=/dev/input/touchscreen0
# 指定觸摸屏校準文件pointercal存放位置
export TSLIB_CALIBFILE=/etc/pointercal
# 指定TSLIB配置文件的位置
export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf
# 指定觸摸屏插件所在路徑
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
# 指定幀緩衝設備
export
 TSLIB_FBDEVICE=/dev/fb0
# 設定控制檯設備爲none
# 不然默認爲/dev/tty,
# 這樣會出現」open consol device:No such file or directory KD…..」的錯誤
export TSLIB_CONSOLEDEVICE=none
# 指定TSLIB的庫文件路徑
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:TSLIB_ROOT/lib
# 指定觸摸屏設備
export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen0
注意:
(1)/etc/profile文件是指rootfs上的/etc/profile,不是PC機;
(2)/home/system/tslib是我本身存放tslib的文件路徑,其餘人可自定義;
(3)/etc/pointercal是tslib/bin/ts_calibrate程序生產的,
將tslib移植入開發板,在開發板終端上運行:
cd /home/system/tslib/bin
./ts_calibrate
以後用手指點擊液晶屏上的「+」,如此5次以後,便會自動在/etc下生成pointercal文件
取消/usr/local/tslib/etc/ts.conf中的第一個註釋:
# module_raw input (去掉#,而且該行頂格,不頂格會出錯)
啓動開發板,運行/usr/local/tslib/bin/ts_calibrate進行校訂觸摸屏。此時若是遇到問題,可以下解決:
問題1:
./ts_calibrate: error while loading shared libraries: libts-0.0.so.0: cannot open shared object file: Error 40
./ts_calibrate: error while loading shared libraries: libts-0.0.so.0: cannot open shared object file: No such file or directory

解決方法:
#echo $LD_LIBRARY_PATH              // 查看lib路徑
#export LD_LIBRARY_PATH=$TSLIB_ROOT/lib

問題2:
ts_open: No such file or directory
解決方法:
#export TSLIB_TSDEVICE=/dev/input/event0     // 觸摸屏設備路徑

問題3:
Couldnt open tslib config file: No such file or directory
ts_config: Illegal seek
解決方法:
#export TSLIB_CONFFILE=$TSLIB_ROOT/etc/ts.conf

問題4:
Couldnt load module pthres No raw modules loaded.
ts_config: Success
解決方法:
#export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts

問題5:
No raw modules loaded.

ts_config: No such file or directory
解決方法:
修改$TSLIB_ROOT/etc/ts.conf,至少放開一個module_raw,打開tslib-1.4/etc/ts.conf文件,
去掉其中一個modules_raw前面的#符號,並刪除空格便可並去掉前面空格
spa

相關文章
相關標籤/搜索