QT5.4.1移植到iTOP1442上触摸屏没反应

tsy20100200 2015-04-22 07:02:25
两个关键的文件设置如下
1、/etc/init.d/rcS

#! /bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel

#
# Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
trap ":" INT QUIT TSTP
/bin/hostname iTOP-4412

[ -e /proc/1 ] || /bin/mount -n -t proc none /proc
[ -e /sys/class ] || /bin/mount -n -t sysfs none /sys
[ -e /dev/tty ] || /bin/mount -t ramfs none /dev

echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s
/bin/hotplug

mkdir -p /dev/pts
mkdir -p /dev/shm
/bin/mount -n -t devpts none /dev/pts -o mode=0622
/bin/mount -n -t tmpfs tmpfs /dev/shm
/bin/mount -n -t ramfs none /tmp
/bin/mount -n -t ramfs none /var
mkdir -p /var/empty
mkdir -p /var/log
mkdir -p /var/log/boa
mkdir -p /var/lock
mkdir -p /var/run
mkdir -p /var/tmp

ln -sf /dev/ttyS2 /dev/tty2
ln -sf /dev/ttyS2 /dev/tty3
ln -sf /dev/ttyS2 /dev/tty4

amixer cset numid=5 127
amixer cset numid=6 1
amixer cset numid=30 8,0
amixer cset numid=40 1
amixer cset numid=43 1
amixer cset numid=47 1

/sbin/hwclock -s -f /dev/rtc

syslogd
/etc/rc.d/init.d/netd start
echo " " > /dev/ttySAC2
echo "Starting networking..." > /dev/ttySAC2

echo "*************************************" > /dev/ttySAC2
echo " http://www.topeetboard.com " > /dev/ttySAC2
echo "*************************************" > /dev/ttySAC2

sleep 2

/etc/firmware/load_firmware


/sbin/ifconfig lo 127.0.0.1

/etc/init.d/ifconfig-eth0


echo 0 > /proc/sys/kernel/hung_task_timeout_secs

echo "Starting Qt5, please waiting..." > /dev/ttySAC2

#=====================================
export TSLIB_ROOT=/usr/local/tslib
export TSLIB_TSDEVICE=/dev/input/event2
export TSLIB_TSEVENTTYPE=input
export TSLIB_CONFFILE=/usr/local/tslib/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/tslib/lib/ts
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_PLUGINDIR=$TSLIB_ROOT/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0

export LD_LIBRARY_PATH=/opt/qt5/lib:/opt/qt5/plugins/audio:/opt/qt5/plugins/iconengines:/opt/qt5/plugins/platforminputcontexts:/opt/qt5/plugins/position:/opt/qt5/plugins/sensorgestures:/opt/qt5/plugins/bearer:/opt/qt5/plugins/imageformats:/opt/qt5/plugins/platforms:/opt/qt5/plugins/qml1tooling:/opt/qt5/plugins/sensors:/opt/qt5/plugins/generic:/opt/qt5/plugins/mediaservice:/opt/qt5/plugins/playlistformats:/opt/qt5/plugins/qmltooling:/opt/qt5/plugins/sqldrivers:/usr/local/tslib/lib:$LD_LIBRARY_PATH

export QT_QPA_PLATFORM_PLUGIN_PATH=/opt/qt5/plugins/platforms
export QT_QPA_PLATFORM=linuxfb:tty=/dev/fb0
export QT_QPA_FONTDIR=/opt/qt5/lib/fonts
export QT_QPA_GENERIC_PLUGINS=tslib:/dev/input/event2

#===============
/bin/qt5

#must run this shell
/bin/sh

2、/bin/qt5


#!/bin/sh

if [ -c /dev/input/event2 ]; then
export QT_QPA_GENERIC_PLUGINS='tslib:/dev/input/event2'
if [ -e /etc/pointercal ] ; then
fsize=$(/bin/ls -al /etc/pointercal | cut -d' ' -f 23)
echo $fsize
if [ $fsize -ge "1" ]; then
echo "/etc/pointercal is exit"
else
echo "/etc/pointercal is empty"
rm /etc/pointercal
/usr/local/tslib/bin/ts_calibrate
fi
else
echo "/etc/pointercal not found"
/usr/local/tslib/bin/ts_calibrate
fi
else
export QT_QPA_GENERIC_PLUGINS="MouseMan:/dev/input/mice"
fi


FB_SIZE=$(cat /sys/class/graphics/fb0/virtual_size)


#export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
case "$FB_SIZE" in
800,480)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
480,272)
export QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1"
;;
*)
export QWS_DISPLAY="LinuxFb:mmWidth91:mmHeight53:1"
;;
esac

export HOME=/root/


QT5.4.1能正常运行,但是触摸屏没有反应,触摸屏无法触摸,个人感觉是QWS_DISPLAY变量的问题,应该如何修改??
...全文
872 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
kernel2010 2017-09-15
  • 打赏
  • 举报
回复
引用 8 楼 GANZHIABC 的回复:
[quote=引用 7 楼 froxy 的回复:] 你移植的时候出现过这个问题吗 我移植的是qt5.5.1 In file included from io/forkfd_qt.cpp:80: io/../../3rdparty/forkfd/forkfd.c: In function 'int forkfd(int, pid_t*)': io/../../3rdparty/forkfd/forkfd.c:555: error: 'EFD_CLOEXEC' was not declared
请问你这个问题解决了嘛?能否指点一二 [/quote] EFD_CLOEXEC 这个宏来自于头文件 eventfd.h 如果你的编译器没有这个头文件,QT在编译时就不会把该文件包含进去,但是源码中却使用了该宏,因此报错;解决办法:更新编译器的头文件版本或者干脆换编译器。
GANZHIABC 2016-08-10
  • 打赏
  • 举报
回复
引用 7 楼 froxy 的回复:
你移植的时候出现过这个问题吗 我移植的是qt5.5.1 In file included from io/forkfd_qt.cpp:80: io/../../3rdparty/forkfd/forkfd.c: In function 'int forkfd(int, pid_t*)': io/../../3rdparty/forkfd/forkfd.c:555: error: 'EFD_CLOEXEC' was not declared
请问你这个问题解决了嘛?能否指点一二
froxy 2016-04-11
  • 打赏
  • 举报
回复
你移植的时候出现过这个问题吗 我移植的是qt5.5.1 In file included from io/forkfd_qt.cpp:80: io/../../3rdparty/forkfd/forkfd.c: In function 'int forkfd(int, pid_t*)': io/../../3rdparty/forkfd/forkfd.c:555: error: 'EFD_CLOEXEC' was not declared
tsy20100200 2015-04-24
  • 打赏
  • 举报
回复
昨天晚上编译了QT5.3.2其余的正常,但是还是触摸屏不能用,可以断定肯定是那里设置错了
zhxianbin 2015-04-23
  • 打赏
  • 举报
回复
引用 3 楼 tsy20100200 的回复:
QWS_DISPLAY这个变量是5.0.2之前版本用的,但是我不知道之后的版本应该用什么变量,我参照http://blog.csdn.net/newthinker_wei/article/details/39560109移植的,那个大神没有约到这样的问题
这篇文章是 5.3.2 的,估计应该适用, QWS_DISPLAY="LinuxFb:mmWidth76:mmHeight44:1" 这个设置明显只和显示有关,和触摸没什么关系 楼主可以试试 5.3.2 行不行
tsy20100200 2015-04-23
  • 打赏
  • 举报
回复
QWS_DISPLAY这个变量是5.0.2之前版本用的,但是我不知道之后的版本应该用什么变量,我参照http://blog.csdn.net/newthinker_wei/article/details/39560109移植的,那个大神没有约到这样的问题
zhxianbin 2015-04-23
  • 打赏
  • 举报
回复
qt5.1 的时候,我移植后也是触摸屏不能用,网上也能Google到有同样问题的,后来也没解决 不应该是 QWS_DISPLAY,应该是 tslib 设置 或者 不使用tslib,好像还有其他的输入方式
帅得不敢出门 2015-04-23
  • 打赏
  • 举报
回复
感觉是tslib不对吧。
tsy20100200 2015-04-23
  • 打赏
  • 举报
回复
QT5.4.1触摸屏问题我弄了两周多还没有结果,那我先弄弄QT5.3.2有没有这样的问题,

23,116

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
  • 应用程序开发区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧