Fixed chrysn's patch: it only works for NO_SYS :-(

This commit is contained in:
Simon Goldschmidt 2014-01-14 21:48:58 +01:00
parent 2cf5eec62f
commit 9975dbeded

View File

@ -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",