66static u32_t timeouts_last_time;
71static int tcpip_tcp_timer_active;
79tcpip_tcp_timer(
void *
arg)
86 if (tcp_active_pcbs || tcp_tw_pcbs) {
91 tcpip_tcp_timer_active = 0;
104 if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
106 tcpip_tcp_timer_active = 1;
119ip_reass_timer(
void *
arg)
151dhcp_timer_coarse(
void *
arg)
165dhcp_timer_fine(
void *
arg)
181autoip_timer(
void *
arg)
247 timeouts_last_time =
sys_now();
261#if LWIP_DEBUG_TIMERNAMES
272 if (timeout ==
NULL) {
273 LWIP_ASSERT(
"sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout !=
NULL);
277 timeout->
h = handler;
279 timeout->
time = msecs;
280#if LWIP_DEBUG_TIMERNAMES
281 timeout->handler_name = handler_name;
283 (
void *)timeout, msecs, handler_name, (
void *)
arg));
286 if (next_timeout ==
NULL) {
287 next_timeout = timeout;
291 if (next_timeout->
time > msecs) {
292 next_timeout->
time -= msecs;
293 timeout->next = next_timeout;
294 next_timeout = timeout;
296 for(t = next_timeout; t !=
NULL; t = t->
next) {
302 timeout->next = t->
next;
325 if (next_timeout ==
NULL) {
329 for (t = next_timeout, prev_t =
NULL; t !=
NULL; prev_t = t, t = t->
next) {
330 if ((t->h == handler) && (t->arg ==
arg)) {
333 if (prev_t ==
NULL) {
334 next_timeout = t->
next;
339 if (t->next !=
NULL) {
358sys_check_timeouts(
void)
370 diff = now - timeouts_last_time;
373#if PBUF_POOL_FREE_OOSEQ
374 PBUF_CHECK_FREE_OOSEQ();
377 tmptimeout = next_timeout;
378 if (tmptimeout && (tmptimeout->
time <= diff)) {
381 timeouts_last_time = now;
382 diff -= tmptimeout->
time;
383 next_timeout = tmptimeout->
next;
384 handler = tmptimeout->
h;
386#if LWIP_DEBUG_TIMERNAMES
387 if (handler !=
NULL) {
389 tmptimeout->handler_name,
arg));
393 if (handler !=
NULL) {
408sys_restart_timeouts(
void)
410 timeouts_last_time =
sys_now();
434 if (next_timeout->
time > 0) {
444 tmptimeout = next_timeout;
445 next_timeout = tmptimeout->
next;
446 handler = tmptimeout->
h;
448#if LWIP_DEBUG_TIMERNAMES
449 if (handler !=
NULL) {
451 tmptimeout->handler_name,
arg));
455 if (handler !=
NULL) {
470 if (time_needed < next_timeout->
time) {
471 next_timeout->
time -= time_needed;
473 next_timeout->
time = 0;
#define LWIP_UNUSED_ARG(x)
#define LWIP_DEBUGF(debug, message)
#define LWIP_ASSERT(message, assertion)
void * memp_malloc(memp_t type)
void memp_free(memp_t type, void *mem)
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
#define LOCK_TCPIP_CORE()
#define LWIP_TCPIP_THREAD_ALIVE()
#define UNLOCK_TCPIP_CORE()
void tcp_timer_needed(void)
void(* sys_timeout_handler)(void *arg)
void sys_timeouts_init(void)
void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)
void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg)
void sys_untimeout(sys_timeout_handler handler, void *arg)