tslib編譯

參考:

http://hi.baidu.com/huicxu/blog/item/3b7086c348f01b080ff47783.html

工具:

apt-get install autoconf

apt-get install libtool

配置

./autogen.sh

 ./configure --prefix=/usr/local/tslib --host=arm-none-linux-gnueabi ac_cv_func_malloc_0_nonnull=yes

make 

make install



下面問題的解決方法參考:

http://www.arm9home.net/simple/index.php?t11074.html


我用ts_test測試終端打印了
tslib: Selected device uses a different version of the event protocol than tslib was compiled for

查看tslib源代碼發現打印該信息的語句在tslib的源代碼的plugs文件夾中input-raw.c的
static int check_fd(struct tslib_input *i)函數中,發現tslib在加載linux觸摸屏驅動模塊時會檢查內核的輸入子系統的
版本號:
         if (ioctl(ts->fd, EVIOCGVERSION, &version) < 0) {
        fprintf(stderr, "tslib: Selected device is not a Linux input event device\n");
        return -1;
            }
        上面程序段將驅動的版本號存放在整型的version中
    if (version != EV_VERSION) {
        fprintf(stderr, "tslib: Selected device uses a different version of the event protocol than tslib was compiled for\n");
        return -1;
    }
        該程序將獲得的版本號version與本tslib的面向的版本號匹配,若不同則打印:
        tslib: Selected device uses a different version of the event protocol than tslib was compiled for
        信息
        
    
再看arm交叉編譯工具中的頭文件庫中的linux/input.h中的EV_VERSION定義爲
    #define EV_VERSION        0x010000
而linux內核include/linux/input.h中的EV_VERSION定義爲
    #define EV_VERSION        0x010001
由此可見問題就出現在內核的輸入子系統的版本號不匹配的問題
    
    
解決辦法:(以下2種任選其一)
    1.將內核源代碼裏的include/linux/input.h中的
    #define EV_VERSION        0x010001
    改爲:
    #define EV_VERSION        0x010000

    再編譯內核文件

    2.將arm交叉編譯工具中的頭文件庫中的
    linux/input.h中的
    #define EV_VERSION        0x010000
    改爲
    #define EV_VERSION        0x010001
    再編譯tslib庫



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章