mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-10-05 22:29:49 +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 */
|
#endif /* LWIP_DEBUG_TIMERNAMES */
|
||||||
{
|
{
|
||||||
struct sys_timeo *timeout, *t;
|
struct sys_timeo *timeout, *t;
|
||||||
|
#if NO_SYS
|
||||||
u32_t now, diff;
|
u32_t now, diff;
|
||||||
|
#endif
|
||||||
|
|
||||||
timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
|
timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT);
|
||||||
if (timeout == NULL) {
|
if (timeout == NULL) {
|
||||||
@ -334,6 +336,7 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if NO_SYS
|
||||||
now = sys_now();
|
now = sys_now();
|
||||||
if (next_timeout == NULL) {
|
if (next_timeout == NULL) {
|
||||||
diff = 0;
|
diff = 0;
|
||||||
@ -341,11 +344,16 @@ sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
|
|||||||
} else {
|
} else {
|
||||||
diff = now - timeouts_last_time;
|
diff = now - timeouts_last_time;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
timeout->next = NULL;
|
timeout->next = NULL;
|
||||||
timeout->h = handler;
|
timeout->h = handler;
|
||||||
timeout->arg = arg;
|
timeout->arg = arg;
|
||||||
|
#if NO_SYS
|
||||||
timeout->time = msecs + diff;
|
timeout->time = msecs + diff;
|
||||||
|
#else
|
||||||
|
timeout->time = msecs;
|
||||||
|
#endif
|
||||||
#if LWIP_DEBUG_TIMERNAMES
|
#if LWIP_DEBUG_TIMERNAMES
|
||||||
timeout->handler_name = handler_name;
|
timeout->handler_name = handler_name;
|
||||||
LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
|
LWIP_DEBUGF(TIMERS_DEBUG, ("sys_timeout: %p msecs=%"U32_F" handler=%s arg=%p\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user