请教:
lwip中,当由sys_timeout产生一个定时器事件时,这个定时器是怎样来定时的,需要同系统时钟(假设ucos)联系起来吗? TCP的高精度时钟(250ms)是怎样实现的呢?
看了LWIP的源码:以下为sys_timeout函数
Create a one-shot timer (aka timeout). Timeouts are processed in the
following cases:
while waiting for a message using sys_mbox_fetch()
while waiting for a semaphore using sys_sem_wait() or sys_sem_wait_timeout()
while sleeping using the inbuilt sys_msleep()
[url=home.php?mod=space&uid=3142012]@param[/url] msecs time in milliseconds after that the timer should expire
@param h callback function to call when msecs have elapsed
@param arg argument to pass to the callback function
/
void sys_timeout(u32_t msecs, sys_timeout_handler h, void arg)
是不是依靠sys_mbox_fetch(),sys_sem_wait() or sys_sem_wait_timeout(),sys_msleep()来实现定时的
可能这是我想当然,可能定时器是依靠别的方式工作的,请各位赐教
谢谢!
更多回帖