zoukankan      html  css  js  c++  java
  • Contiki-Timer 概述

    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

  • 相关阅读:
    二维空间轨迹聚类
    Java 格式化输出
    Linux 小笔记
    Nginx ServerName 配置说明(转)
    LVS
    Nginx + tomcat 实现简单集群(基于反向代理方式)
    mysql 外键
    tomcat 日志输出
    tomcat https
    SpringMVC表单标签简介
  • 原文地址:https://www.cnblogs.com/songdechiu/p/5951799.html
Copyright © 2011-2022 走看看