Tslib1.0 Port

Source: Internet
Author: User

To transplant QT, you must support the tslib touch screen correction program. The following describes how to compile and transplant tslib1.0.

: Http://www.rayfile.com/zh-cn/files/a01f838a-c1bb-11e0-aaa6-0015c55db73d/


# Tar zxvf tslib-1.0.tar.bz2

1. Generate a. configure file

./Autogen. Sh

2. Specify the cross compiler and configuration script

# Cc = arm-Linux-GCC // select Cross Compiler

#./Configure -- Host = arm-Linux -- prefix = $ PWD/../tslib1.0 _ target -- enable-inputapi = No

// Create the target folder in the first-level directory of the current path

# Exportplugin_dir = $ PWD/plugins

3. Compile

There is a line in tslib-1.0 \ config. h defining "# define malloc rpl_malloc", directly comment

# Make

# Make install

The tslib_target folder will be created under the same level as the current directory, which contains bin/etc/include/lib/and other folders

 

3. port to the Development Board

1) Create the tslib folder in the usr/directory of the Development Board and copy the Four folders to the tslib directory.

# Cd/usr/

# Mkdir/usr/tslib

# Cp tslib_target/*/usr/tslib-R

2) Modify/usr/tslib/etc/ts. conf to remove the blocking of the first sentence.

# Module_raw Input

Change

Module_raw input (note that there is no space before it)

3) modify the/profile file under the/etc directory of the Development Board, add the following STARTUP script and run it.

# Vi/etc/profile

Export t_root =/usr/tslib # directory

Exportpath = $ path: $ t_root/bin # Add the executable program directory to the Environment Variable

Exportld_library_path =/lib:/usr/lib: $ t_root/lib # library file directory

Export tslib_consoledevice = none

Export tslib_fbdevice =/dev/fb0 # framebuffer Device File

Export tslib_tsdevice =/dev/event0 # Touch Screen Device File

Export tslib_calibfile =/etc/pointercal # specify the storage location of the touch screen calibration file pintercal

Export tslib_conffile = $ t_root/etc/ts. conf # configuration file of the tslib Module

Export tslib_plugindir = $ t_root/lib/TS/# directory of the tslib plug-in Library

Echo "ts init success! "

4. Use and Test

1) ts_calibrate

After the task is executed, five dots are displayed on the screen. click Calibrate in sequence. After the calibration is completed, a pointercal file is generated under/etc for use by other programs. ts_calibrate is an application, draw a few buttons on the screen to write the calibration data obtained from the TS driver and the coordinate position on the screen through a set of algorithms to a calibration file.

2) ts_print prints the screen coordinates

Abscissa ordinate

1796351007.320859: 156 116 500 Press

1796351007.355145: 156 116 0 lifted

3) ts_print_raw prints the original screen coordinate data.

1796350964.530867: 216 865 1 Press

1796350989.946831: 0 0 0 lift

4) ts_test checks the calibration result. If the cross cursor moves with the finger during touch


5. answers to common errors

1)

The following error is prompted during the make process:

Libtool: Link: only absolute run-paths areallowed

Forgot to specify the environment variable: exportplugin_dir = $ PWD/plugins

2)

Ts_config: Success

After tracing, an error occurs in opening ts_config.

The Directory of the tslib plug-in library is not specified

Exporttslib_plugindir = $ t_root/share/TS/plugins/# tslib plug-in library directory

3)

Ts_open: Inappropriate ioctol for Device

The Touch Screen driver of the Board does not support IOCTL operations.

Add the -- enable-inputapi = No parameter to. Configure.

4)
./Ts_calibrate: Error while loading shared libraries: libts-0.0.so.0: cannotopen shared object file: Error 40
./Ts_calibrate: Error while loading shared libraries: libts-0.0.so.0: cannotope
N shared object file: no such file or directory

Solution:
# Echo $ LD_LIBRARY_PATH // view the Lib path,
# Export LD_LIBRARY_PATH = $ t_root/lib

5)
Ts_open: no such file or directory
Solution:
# Export tslib_tsdevice =/dev/input/event0 // touch screen device path

6)
Couldnt open tslib config file: no such file or directory ts_config: illegalseek
Solution:
# Export tslib_conffile = $ t_root/etc/ts. conf

7)
Couldnt load module pthres
No raw modules loaded.
Ts_config: Success
Solution:
# Export tslib_plugindir = $ t_root/lib/TS

8)
No raw modules loaded.
Ts_config: no such file or directory
Solution:
Modify $ t_root/etc/ts. conf, open at least one module_raw, and remove the leading space.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.