1.
CompileVery depressed some time ago... Because an error always occurs when you run the generated calibration program ts_calibrate:
Ts_open: Inappropriate ioctol for DeviceAfterwards, I learned that it was the touch screen drive of my own board after numerous twists and turns.
Not SupportedIOCTLOperation, Crazy sweat...
Recompile tslibCD tslib-1.3 export cc =/usr/local/ARM/2.95.3/bin/ARM-Linux-GCC // specify cross compiler. /autogen. sh // generate the config file export Path =/usr/local/ARM/2.95.3/bin: $ PATH echo "ac_cv_func_malloc_0_nonnull = yes"> arm-linux.cache. /configure -- Host = arm-Linux -- cache-file = arm-linux.cache
-- Enable-inputapi = NoVI src/ts_read_raw.c // The modification content is as follows: Make ****************************** before making, to support touch screen, open the src/ts_read_raw.c file, view the data structure of the touch screen driver, and check the char * defaulttseventtype = "ucb1x00 "; modify it to the driver structure corresponding to the current Board. Because my driver corresponds to the h3600_ts_event structure typedef struct {unsigned short pressure; unsigned short X; unsigned short Y; unsigned short pad;} ts_ret;, modify it:
Char * defaulttseventtype = "h3600 ";* ************************************ If the source code is not modified, you can also re-specify the environment variable export tslib_tseventtype = h3600 in the subsequent tests. // use this to define the device struct in tslib *************** ************************************* if you the Touch Screen driver supports IOCTL operations, in the configure operation above, you can delete -- enable-inputapi = No. Then you can make *********************************** **************
2.
Test:
2.1
I am at/root/share
A new tslib
Directory,
Copy only
Some required filesMkdir/root/share/tslib/tests mkdir/root/share/tslib/plugins mkdir/root/share/tslib mkdir/root/share/ tslib/etc CP/root/2410 S/tslib-1.3/tests /. libs/TS _ */root/share/tslib/tests // Several required test files, such as the generated calibration file, test files and so on CP/root/2410 S/tslib-1.3/src /. libs/libts-0.0.so.0 */root/share/tslib/lib // Several required library files CP/root/2410 S/tslib-1.3/src /. libs/libts. so/root/share/tslib/lib // Several required library files CP/root/2410 S/tslib-1.3/plugins /*. so/root/share/tslib/plugins // touch screen plug-in module library CP/root/2410 S/tslib-1.3/etc/ts. conf/root/share/tslib/etc // configuration file
2.2
Connection BoardRun the minicom Mount-T nfs-O nolock 192.168.0.155:/root/share/mnt/nfs command to mount the board to the PC. The shared path is/root/share.
2.3
Link CreationLn-S/dev/FB/0/dev/fb0 // The/dev/FB/0 sub-board of the frame buffer device, but the default value of the program is/dev/fb0, so I made a link/dev/fb0 to/dev/FB/0 ln-SF/dev/touchscreen/0raw/dev/TS // qtopia to open/dev/TS, you do not have this file, so there should be a touch-level node under Dev, which is equivalent to qtopia starting to find/dev/TS, but you only have/dev/touchscreen/0raw, so you can link ts to your touch screen file! The node file of the touch screen device is/dev/touchscreen/0raw, create a link/dev/ts to/dev/touchscreen/0raw (here you need to set the specific files on your own board, or else an error will be reported)
2.4
Environment VariableExport qws_mouse_proto = tpanel: /dev/touchscreen/0raw export t_root =/mnt/nfs/tslib export LD_LIBRARY_PATH = $ t_root/lib // specify the console required for running tslib library file path export tslib_consoledevice = NONE // tslib, here is the LCD screen, set the console device to none, otherwise the default value is/dev/tty, export tslib_fbdevice =/dev/fb0 // specify the frame buffer device export tslib_tsdevice =/dev/touchscreen/0raw // specify the node File Export tslib_calibfile = $ t_root/etc/pointercal // specify the storage location of the touch screen calibration file pintercal ******************************** * *********************************** note: the calibration file in/src/kernel/qwsmouse_qws.cpp of QTE is opened under/etc/pointercal by default, but the root file system of the board is read-only, so I put it under/mnt/nfs/tslib/etc, therefore, you must modify qwsmouse_qws.cpp ************************************ during cross-Compilation of QTE ****************************** * ******************* export tslib_conffile = $ t_root/etc/ts. conf // specify the location of the tslib Configuration File Export tslib_plugindir = $ t_root/plugins // specify the path of the touch screen plug-in
2.5
CalibrationRun the calibration program Calibration screen (5-point calibration) CD $ t_root/tests. /ts_calibrate // five cursors appear on the board one after another, after clicking this button, the calibration file pintercal will be generated and stored under $ t_root/etc ************************ * ******************* 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. **************************************** **
3.
Possible error analysis:Run. /ts_calibrate again has a very depressing error: ts_config: success after tracing, it should have encountered an error in opening ts_config (success is reported unexpectedly, it is not desirable) I found this error on the Internet (this is the error in version 1.4): couldnt load module input no raw modules loadedtsconfig: success I have no errors in the above two lines, but it should be the same cause of the error, so the error is located in ts_config. In addition, we can further determine that the error "ts_load_module.c" is returned when loading the plug-in module. This file is found to be different from your own on the Internet (the source code published on the internet is 1.4 or 0.1.1) my is 1.3 I downloaded the tslib-0.1.1 and re-experiment found that the error is like this (the first error is caused by ts. determined by conf) couldnt load module pthres no raw modules loadedtsconfig: Success reads the original tslib code and knows a function in the cstdlib Library: getenv is used to obtain the value of the specified system environment variable. To test whether tslib obtains correct environment variables. The default value of its environment variable is included in readme. Error analysis when loading the plug-in module: ts_calibrate will open the ts_configts_config function and read the tslib configuration file (TS. conf, specified by the tslib_conffile environment variable, under tslib/etc), and then load the Ts of version 1.3 of the plug-in library one by one based on the file. the conf content is module mousebutsmoudle variance xlimit = 50 ylimit = 50 pthreshold = 3 Moudle dejitter xdelta = 1 ydelta = 1 pthreshold = 3 Moudle linear ts_config, and ts_load_module is called to load. From this function, the program first obtains the name of the loaded module specified in the configuration file, constructs a so file name based on the module name, and then calls the system function dlopen to load the library! Loading dlopen in Linux is similar to the function of dynamically linking a library in Windows: A dlopen error occurs when the file name in the constructed library is incorrect-the specified file does not exist-leading to the failure of loading dlopen. Therefore, the system prompts that the file or directory cannot be found! In this case, the required mousebuts. so variance. so dejitter. so linear. so should be copied to/tslib/plugins (this step can be performed after the above correction, so there will be no error pulling) **************************************
Let's talk about tslib-1.4,
And 1.3
There is a little difference, mainly because of the differences in configuration files.In general, tsllib-1.4 is a complete ts. the conf configuration file is as follows: module_raw input module pthres module variance Delta = 30 module dejitter Delta = 100 module linear this error occurs in couldnt load module input no raw modules loadedtsconfig: the first line of success tells tslib to read data from the Linux input device. The input module is used, that is, the input in the plugin directory. so file, so your tslib_plugindir must be correctly configured so that tslib can find the module File. Other parameters control the continuous download, variation width, trajectory change, and linear calibration of the touch point. Also, copy the required library files to the second line of/tslib/plugins, resulting in "no raw modules loaded. there are two reasons: Note: first, your Ts. module_raw is not specified in Conf, and Ts is included in it. all modules of conf are commented out, # uncomment if you wish to use the Linux input layer event interface # module_raw input # uncomment if you're using a sharp zaurus SL-5500/SL-5000d # module_raw Collie # uncomment if you're using sharp zaurus SL-C700/c750/c760/c860 # module_raw corgi # uncomment if you' Re using a device with a ucb1200/1300/1400 ts interface # module_raw ucb1x00 # uncomment if you're using an HP ipaq h3600 or similar # module_raw h3600 # uncomment if you're using a Hitachi webpad # module_raw mk712 # uncomment if you're using an IBM Arctic II # module_raw arctic2 you should open at least one module_raw option, someone selects input and removes the comments to get module_raw input. Another reason is that you have not correctly configured tslib_plugindir. tslib does not find the module File required for plugin from the directory you specified. Please check Check your path and file.