找回密码
 注册
搜索
查看: 1523|回复: 8

[讨论] 有谁知道gui_start_timer具体是如何实现的?

[复制链接]
发表于 2010-5-24 17:30:57 | 显示全部楼层 |阅读模式
MTK gui.c开源部分是这样定义gui_start_timer,具体实现未公开!
/*----------------------------------------------------------------------------
Function Pointer: gui_start_timer
Description:      One shot timer
Input Parameters: count    is the delay (Implementation dependent: Normally milliseconds)
               callback is the function that is called when the timer expires
Output Parameters:   none
Returns:       void
Remakrs:       NOTE: DO NOT USE UI TIMER IN CRITICAL CASES
               UI timer will be suspended when LCD backlight is turned off.
----------------------------------------------------------------------------*/

void (*gui_start_timer) (S32 count, void (*callback) (void)) = NULL;

已知:
StartTimer与gui_start_timer相同的延时时间,但响应速度却不一样,gui_start_timer反应更加及时。

请问有谁知道这两个函数具体的差异?为什么gui_start_timer反应更加及时?
发表于 2010-5-24 22:46:15 | 显示全部楼层
mtk平台的timer有两种:
aligned timer                  非精确
non-aligned timer           精确

gui用的是后者
点评回复

使用道具 举报

发表于 2010-5-25 10:54:19 | 显示全部楼层
楼上正解,非队列timer虽然及时,但是在背光关闭时无法使用。
点评回复

使用道具 举报

发表于 2010-5-25 12:19:03 | 显示全部楼层
跟进去看一下就知道了啊
点评回复

使用道具 举报

 楼主| 发表于 2010-5-25 12:50:38 | 显示全部楼层
但是即使我使用nonalign模式,感觉还是gui timer快,这是怎么回事呢?
点评回复

使用道具 举报

发表于 2010-5-25 22:49:50 | 显示全部楼层
gui_start_timer 实际是Stack timer的封装,stack timer分为align timer和unalign timer两种,unalign timer精确度较高,在机器进入sleep以后,时间到后unalign timer会马上相应,align则不会。
stack timer精度都是任务级的,就是一个Tick,但会受到其他高优先级的任务影响。如果对timer 精度要求很高,可以用kal_set_timer,这个尽量少用!
点评回复

使用道具 举报

发表于 2010-5-27 15:52:52 | 显示全部楼层
分析的很好,多谢。
点评回复

使用道具 举报

发表于 2010-5-31 15:58:32 | 显示全部楼层
void (*gui_start_timer) (S32 count, void (*callback) (void)) = NULL;
这是一个函数指针,你看他在那里赋值就可以找到其所指的函数的具体定义了。
点评回复

使用道具 举报

发表于 2010-5-31 16:28:50 | 显示全部楼层
学习中。。。
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-2-26 07:37 , Processed in 0.046472 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表