64 static u32_t timeouts_last_time;
69 static int tcpip_tcp_timer_active;
77 tcpip_tcp_timer(
void *
arg)
84 if (tcp_active_pcbs || tcp_tw_pcbs) {
89 tcpip_tcp_timer_active = 0;
102 if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
104 tcpip_tcp_timer_active = 1;
117 ip_reass_timer(
void *arg)
149 dhcp_timer_coarse(
void *arg)
163 dhcp_timer_fine(
void *arg)
179 autoip_timer(
void *arg)
195 igmp_timer(
void *arg)
245 timeouts_last_time =
sys_now();
259 #if LWIP_DEBUG_TIMERNAMES
270 if (timeout ==
NULL) {
271 LWIP_ASSERT(
"sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout !=
NULL);
275 timeout->
h = handler;
277 timeout->
time = msecs;
278 #if LWIP_DEBUG_TIMERNAMES
279 timeout->handler_name = handler_name;
281 (
void *)timeout, msecs, handler_name, (
void *)arg));
284 if (next_timeout ==
NULL) {
285 next_timeout = timeout;
289 if (next_timeout->
time > msecs) {
290 next_timeout->
time -= msecs;
291 timeout->
next = next_timeout;
292 next_timeout = timeout;
294 for(t = next_timeout; t !=
NULL; t = t->
next) {
323 if (next_timeout ==
NULL) {
327 for (t = next_timeout, prev_t =
NULL; t !=
NULL; prev_t = t, t = t->
next) {
328 if ((t->h == handler) && (t->arg == arg)) {
331 if (prev_t ==
NULL) {
332 next_timeout = t->
next;
337 if (t->next !=
NULL) {
356 sys_check_timeouts(
void)
372 tmptimeout = next_timeout;
373 if (tmptimeout->
time <= diff) {
376 timeouts_last_time = now;
377 diff -= tmptimeout->
time;
378 next_timeout = tmptimeout->
next;
379 handler = tmptimeout->
h;
380 arg = tmptimeout->
arg;
381 #if LWIP_DEBUG_TIMERNAMES
382 if (handler !=
NULL) {
384 tmptimeout->handler_name, arg));
388 if (handler !=
NULL) {
403 sys_restart_timeouts(
void)
405 timeouts_last_time =
sys_now();
429 if (next_timeout->
time > 0) {
439 tmptimeout = next_timeout;
440 next_timeout = tmptimeout->
next;
441 handler = tmptimeout->
h;
442 arg = tmptimeout->
arg;
443 #if LWIP_DEBUG_TIMERNAMES
444 if (handler !=
NULL) {
446 tmptimeout->handler_name, arg));
450 if (handler !=
NULL) {
465 if (time_needed < next_timeout->
time) {
466 next_timeout->
time -= time_needed;
468 next_timeout->
time = 0;