移植FT6X系列的触摸屏后,发现系统工作并不能像正常触摸屏那样,而是出现了一个小圆圈,像鼠标一样移动,进过查找相关资料,终于发现出现这种状况的原因是因为Android系统把触摸屏当成触摸板,所以才会出现一个像小圆圈一样的东西。
在Android系统中,会按下面的顺序识别配置文件:
/system/usr/idc/Vendor_XXXX_Product_XXXX_Version_XXXX.idc
/system/usr/idc/Vendor_XXXX_Product_XXXX.idc
/system/usr/idc/DEVICE_NAME.idc
/data/system/devices/idc/Vendor_XXXX_Product_XXXX_Version_XXXX.idc
/data/system/devices/idc/Vendor_XXXX_Product_XXXX.idc
/data/system/devices/idc/DEVICE_NAME.idc
我们需要在系统中添加触摸屏的配置文件,才能让系统不把触摸屏识别为触摸板,我们在frameworks/base/data/keyboards下添加ft5x0x_ts.idc文件
#Bsic Parameters
touch.deviceType = touchScreen
touch.orientationAware = 1
# Size
touch.size.calibration = diameter
touch.size.scale = 10
touch.size.bias = 0
touch.size.isSummed = 0
# Pressure
# Driver reports signal strength as pressure.
#
# A normal thumb touch typically registers about 200 signal strength
# units although we don't expect these values to be accurate.
touch.pressure.calibration = amplitude
touch.pressure.scale = 0.005
# Orientation
touch.orientation.calibration = none
重新编译系统,我们可以在/out/target/product/rk3288/system/usr/idc/文件下查找到ft5x0x_ts.idc文件,将system.img下载到板子上,可以在system/usr/idc/下看到ft5x0x_ts.idc文件,这时,系统就可以正常识别触摸屏了。以上工作全部是是在Android4.4系统,kernel3.10版本上测试。