首页 > 其他 > 详细

Contiki-Timer 概述

时间:2016-10-12 11:37:02      阅读:376      评论:0      收藏:0      [点我收藏+]

Contiki有一个clock模块和一系列timer模块:timerstimerctimeretimer,和rtimer

一、clock模块

clock模块提供一些处理系统时间的函数,还有一些用来阻塞CPU的函数。

timer模块的实现以clock模块为基础。

二、timer和stimer模块

timer和stimer提供最简单的形式来判断一段时间是否到期。

timer使用clock tick来判断。

stimer使用秒来判断,可以判断更长的时间间隔。

timer和stimer可以使用在中断中

三、etimer模块

etimer用于在一段时间后向Contiki processes发送event

etimer可使Contiki processes在等待一段时间的同时,可以继续做其他的工作,或者进入低功耗模式。

四、ctimer模块

ctimer提供回调timer,可以在一段时间后调用回调函数。

向etimer模块一样,ctimer使系统在等待一段时间的同时,可以继续工作,或者进入低功耗模式。

因为ctimer是调用回调函数,这在协议的实现中特别有用,Rimer协议栈使用callback timer来处理通信超时。

五、rtimer模块

rtimer用于处理实时任务。

The rtimer library pre-empt any running Contiki process in order to let the real-time tasks execute at the scheduled time. The real-time tasks are used in time critical code such as the X-MAC implementation where the radio needs to be turned on or off at scheduled times without delay.

 

参考资料:https://github.com/contiki-os/contiki/wiki/Timers#The_Contiki_Timer_Modules

Contiki-Timer 概述

原文:http://www.cnblogs.com/songdechiu/p/5951799.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!