mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 09:16:20 +00:00
Fixed chrysn's patch: it only works for NO_SYS :-(
This commit is contained in:
parent
2cf5eec62f
commit
9975dbeded
@ -326,7 +326,9 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
||||
#endif /* LWIP_DEBUG_TIMERNAMES */
|
||||
{
|
||||
struct sys_timeo *timeout, *t;
|
||||
#if NO_SYS
|
||||
u32_t now, diff;
|
||||
#endif
|
||||
|
||||
timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
|
||||
if (timeout == NULL) {
|
||||
@ -334,6 +336,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
||||
return;
|
||||
}
|
||||
|
||||
#if NO_SYS
|
||||
now = sys_now();
|
||||
if (next_timeout == NULL) {
|
||||
diff = 0;
|
||||
@ -341,11 +344,16 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
||||
} else {
|
||||
diff = now - timeouts_last_time;
|
||||
}
|
||||
#endif
|
||||
|
||||
timeout->next = NULL;
|
||||
timeout->h = handler;
|
||||
timeout->arg = arg;
|
||||
#if NO_SYS
|
||||
timeout->time = msecs + diff;
|
||||
#else
|
||||
timeout->time = msecs;
|
||||
#endif
|
||||
#if LWIP_DEBUG_TIMERNAMES
|
||||
timeout->handler_name = handler_name;
|
||||
LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
|
||||
|
Loading…
Reference in New Issue
Block a user