67 static u32_t timeouts_last_time;
72 static int tcpip_tcp_timer_active;
80 tcpip_tcp_timer(
void *
arg)
87 if (tcp_active_pcbs || tcp_tw_pcbs) {
92 tcpip_tcp_timer_active = 0;
105 if (!tcpip_tcp_timer_active && (tcp_active_pcbs || tcp_tw_pcbs)) {
107 tcpip_tcp_timer_active = 1;
119 tcp_timer_coarse(
void *arg)
136 ip_reass_timer(
void *arg)
169 dhcp_timer_coarse(
void *arg)
184 dhcp_timer_fine(
void *arg)
200 autoip_timer(
void *arg)
216 igmp_timer(
void *arg)
272 timeouts_last_time =
NOW();
286 #if LWIP_DEBUG_TIMERNAMES 297 if (timeout ==
NULL) {
298 LWIP_ASSERT(
"sys_timeout: timeout != NULL, pool MEMP_SYS_TIMEOUT is empty", timeout !=
NULL);
302 timeout->
h = handler;
304 timeout->
time = msecs;
305 #if LWIP_DEBUG_TIMERNAMES 306 timeout->handler_name = handler_name;
308 (
void *)timeout, msecs, handler_name, (
void *)arg));
311 if (next_timeout ==
NULL) {
312 next_timeout = timeout;
316 if (next_timeout->
time > msecs) {
317 next_timeout->
time -= msecs;
318 timeout->next = next_timeout;
319 next_timeout = timeout;
321 for(t = next_timeout; t !=
NULL; t = t->
next) {
327 timeout->next = t->
next;
350 if (next_timeout ==
NULL) {
354 for (t = next_timeout, prev_t =
NULL; t !=
NULL; prev_t = t, t = t->
next) {
355 if ((t->h == handler) && (t->arg == arg)) {
358 if (prev_t ==
NULL) {
359 next_timeout = t->
next;
364 if (t->next !=
NULL) {
375 extern uint8 timer2_ms_flag;
383 sys_check_timeouts(
void)
395 if (timer2_ms_flag == 0) {
403 tmptimeout = next_timeout;
404 if (tmptimeout->
time <= diff) {
407 timeouts_last_time = now;
408 diff -= tmptimeout->
time;
409 next_timeout = tmptimeout->
next;
410 handler = tmptimeout->
h;
411 arg = tmptimeout->
arg;
412 #if LWIP_DEBUG_TIMERNAMES 413 if (handler !=
NULL) {
415 tmptimeout->handler_name, arg));
419 if (handler !=
NULL) {
434 sys_restart_timeouts(
void)
436 timeouts_last_time =
NOW();
460 if (next_timeout->
time > 0) {
470 tmptimeout = next_timeout;
471 next_timeout = tmptimeout->
next;
472 handler = tmptimeout->
h;
473 arg = tmptimeout->
arg;
474 #if LWIP_DEBUG_TIMERNAMES 475 if (handler !=
NULL) {
477 tmptimeout->handler_name, arg));
481 if (handler !=
NULL) {
496 if (time_needed < next_timeout->
time) {
497 next_timeout->
time -= time_needed;
499 next_timeout->
time = 0;
void memp_free(memp_t type, void *mem) ICACHE_FLASH_ATTR
void(* sys_timeout_handler)(void *arg)
#define LWIP_TCPIP_THREAD_ALIVE()
#define LOCK_TCPIP_CORE()
void tcp_timer_needed(void)
u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout)
const ip_addr_t ip_addr_any ICACHE_RODATA_ATTR
#define ICACHE_FLASH_ATTR
void * memp_malloc(memp_t type) ICACHE_FLASH_ATTR
#define UNLOCK_TCPIP_CORE()
void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg) ICACHE_FLASH_ATTR
#define LWIP_DEBUGF(debug, message)
#define LWIP_U32_DIFF(a, b)
void sys_untimeout(sys_timeout_handler handler, void *arg) ICACHE_FLASH_ATTR
void sys_timeouts_init(void) ICACHE_FLASH_ATTR
void ICACHE_FLASH_ATTR dhcps_coarse_tmr(void)
#define LWIP_ASSERT(message, assertion)
void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg)
#define LWIP_UNUSED_ARG(x)