保存桌面快捷方式 - - 设为首页 - 手机版
凹丫丫旗下网站:四字成语大全 - 故事大全 - 范文大全
您现在的位置: 范文大全 >> 理工论文 >> 电子通信论文 >> 正文

ucos+lwip应用心得[社区]


timeouts->next->time -= msecs;
    timeout->next = timeouts->next;
    timeouts->next = timeout;
  } else {
    for(t = timeouts->next; t != NULL; t = t->next) {
      timeout->time -= t->time;
      if (t->next == NULL ||
   t->next->time > timeout->time) {
  if (t->next != NULL) {
    t->next->time -= timeout->time;
  }
  timeout->next = t->next;
  t->next = timeout;
  break;
      }
    }
  }
}
函数sys_untimeout从当前任务定时事件链表中删除一个定时事件
void sys_untimeout(sys_timeout_handler h, void *arg)
{
    struct sys_timeouts *timeouts;
    struct sys_timeout *prev_t, *t;
    timeouts = sys_arch_timeouts();//返回当前任务定时事件链表起始指针
    if (timeouts->next == NULL)//如果链表为空直接返回
        {
        return;
        }
    //查找对应定时事件并从链表中删除.
    for (t = timeouts->next, prev_t = NULL; t != NULL; prev_t = t, t = t->next)
    {
        if ((t->h == h) && (t->arg == arg))
        {
            /* We have a match */
            /* Unlink from previous in list */
            if (prev_t == NULL)
                timeouts->next = t->next;
           &nbs

p;else
                prev_t->next = t->next;
            /* If not the last one, add time of this one back to next */
   &nb

《ucos+lwip应用心得[社区](第5页)》
本文链接地址:http://www.oyaya.net/fanwen/view/148424.html

★温馨提示:你可以返回到 电子通信论文 也可以利用本站页顶的站内搜索功能查找你想要的文章。