mtk android tp 运行方式更改
来源:互联网 发布:黄金走势分析软件 编辑:程序博客网 时间:2024/05/02 02:38
将tp运行方式由中断改为轮询模式。
步骤1. probe 中创建线程
thread = kthread_run(my_touch_event_handler, 0, "msg2133");
步骤2. 完成轮询函数
- static int my_touch_event_handler()
- {
- int pending = 0;
- struct TouchInfoT cinfo, pinfo;
- struct sched_param param = { .sched_priority = RTPM_PRIO_TPD };
- sched_setscheduler(current, SCHED_RR, & param);
- memset(&cinfo, 0, sizeof(struct TouchInfoT));
- memset(&pinfo, 0, sizeof(struct TouchInfoT));
- do
- {
- printk("my_touch_event_handler-------------------\n");
- set_current_state(TASK_INTERRUPTIBLE);
- if(!kthread_should_stop())
- {
- ///TPD_DEBUG_CHECK_NO_RESPONSE;
- do
- {
- //if (pending)
- wait_event_interruptible_timeout(waiter, 0, HZ/20);
- //else
- // wait_event_interruptible_timeout(waiter, 0, HZ*2);
- }while(0);
- //if (tpd_flag == 0 && !pending)
- //continue; // if timeout for no touch, then re-wait.
- //if (tpd_flag != 0 && pending > 0)
- //pending = 0;
- tpd_flag = 0;
- //TPD_DEBUG_SET_TIME;
- }
- set_current_state(TASK_RUNNING);
- if (tpd_touchinfo(&cinfo, &pinfo))
- {
- if(cinfo.count >0)
- {
- tpd_down(cinfo.x1, cinfo.y1, cinfo.pressure);
- if(cinfo.count>1)
- {
- tpd_down(cinfo.x2, cinfo.y2, cinfo.pressure);
- }
- input_sync(tpd->dev);
- //TPD_LOGV("[MSG2133]press --->\n");
- }
- else if(cinfo.count==0 && pinfo.count!=0)
- {
- input_mt_sync(tpd->dev);
- input_sync(tpd->dev);
- //TPD_LOGV("[MSG2133]release --->\n");
- }
- }
- }while(1);
- return 0;
- }
- mtk android tp 运行方式更改
- mtk android tp 运行方式更改
- mtk android tp 触感震动无效的更改
- mtk android tp 触感震动无效的更改
- mtk android tp 调试
- Android MTK 修改TP参数
- Android MTK 6572 光感/TP控制
- mtk android mcp camera更改
- mtk android mcp camera更改
- mtk android mcp camera更改
- mtk android mcp camera更改
- MTK Android Camera 运行流程
- MTK Android Camera 运行流程
- MTK TP驱动笔记
- MTK TP驱动移植
- MTK平台TP驱动详解
- MTK TP input子系统笔记
- MTK平台TP驱动详解
- Association
- [Android] Android开发优化之——对界面UI的优化(2)
- UDP有边界,一次一包;TCP是字节流,需要应用层自己判断包边界。
- 迭代器模式(Iterator Pattern)
- 运营商的“逆袭”或将令苹果雪上加霜
- mtk android tp 运行方式更改
- iPhone下xib转成iPad的xib
- Xcode的控制台调试命令
- 如何修改data guard 的“*.db_unique_name”参数
- SqlServer ErrorLog
- MAKEWORD()
- DevExpress TreeList使用心得
- java枚举使用详解
- 获取论文全文的13种方法