Microchip® Advanced Software Framework

lwip_timers_141.c File Reference

Stack-internal timers implementation.

This file includes timer callbacks for stack-internal timers as well as functions to set up or stop timers and check for expired timers.

#include "lwip/opt.h"
#include "lwip/timers.h"
#include "lwip/tcp_impl.h"
#include "lwip/def.h"
#include "lwip/memp.h"
#include "lwip/tcpip.h"
#include "lwip/ip_frag.h"
#include "netif/etharp.h"
#include "lwip/dhcp.h"
#include "lwip/autoip.h"
#include "lwip/igmp.h"
#include "lwip/dns.h"
#include "lwip/sys.h"

Functions

static void arp_timer (void *arg)
 Timer callback function that calls etharp_tmr() and reschedules itself. More...
 
 if (timeout==NULL)
 
 if (next_timeout==NULL)
 
 if (next_timeout->time > msecs)
 
static void ip_reass_timer (void *arg)
 Timer callback function that calls ip_reass_tmr() and reschedules itself. More...
 
void sys_timeouts_init (void)
 Initialize this module. More...
 
void tcp_timer_needed (void)
 Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs. More...
 
static void tcpip_tcp_timer (void *arg)
 Timer callback function that calls tcp_tmr() and reschedules itself. More...
 

Variables

timeout arg = arg
 
timeout h = handler
 
timeout next = NULL
 
static struct sys_timeonext_timeout
 Fix lwIP warning in standalone mode. More...
 
static int tcpip_tcp_timer_active
 global variable that shows if the tcp timer is currently scheduled or not More...
 
timeout time = msecs
 
 timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT)
 
static u32_t timeouts_last_time
 
 void
 Create a one-shot timer (aka timeout). More...
 

static void arp_timer ( void arg)
static

Timer callback function that calls etharp_tmr() and reschedules itself.

Parameters
argunused argument

References ARP_TMR_INTERVAL, etharp_tmr(), LWIP_DEBUGF, LWIP_UNUSED_ARG, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

if ( next_timeout  = NULL)

References timeout.

if ( next_timeout->  time,
msecs   
)
static void ip_reass_timer ( void arg)
static

Timer callback function that calls ip_reass_tmr() and reschedules itself.

Parameters
argunused argument

References ip_reass_tmr(), IP_TMR_INTERVAL, LWIP_DEBUGF, LWIP_UNUSED_ARG, NULL, sys_timeout(), and TIMERS_DEBUG.

Referenced by sys_timeouts_init().

void sys_timeouts_init ( void  )
void tcp_timer_needed ( void  )

Called from TCP_REG when registering a new PCB: the reason is to have the TCP timer only running when there are active (or time-wait) PCBs.

External function (implemented in timers.c), called when TCP detects that a timer is needed (i.e.

References NULL, sys_timeout(), tcp_active_pcbs, TCP_TMR_INTERVAL, tcp_tw_pcbs, tcpip_tcp_timer(), and tcpip_tcp_timer_active.

static void tcpip_tcp_timer ( void arg)
static

Timer callback function that calls tcp_tmr() and reschedules itself.

Parameters
argunused argument

References LWIP_UNUSED_ARG, NULL, sys_timeout(), tcp_active_pcbs, tcp_tmr(), TCP_TMR_INTERVAL, tcp_tw_pcbs, and tcpip_tcp_timer_active.

Referenced by tcp_timer_needed().

timeout h = handler
struct sys_timeo* next_timeout
static

Fix lwIP warning in standalone mode.

The one and only timeout list

Referenced by if().

int tcpip_tcp_timer_active
static

global variable that shows if the tcp timer is currently scheduled or not

Referenced by tcp_timer_needed(), and tcpip_tcp_timer().

timeout time = msecs
timeout = (struct sys_timeo *)memp_malloc(MEMP_SYS_TIMEOUT)

Referenced by if(), and usart_set_rx_timeout().

u32_t timeouts_last_time
static

Referenced by sys_timeouts_init().

void
Initial value:
{
struct sys_timeo *timeout, *t
Definition: timers.h:67
timeout
Definition: lwip_timers_141.c:273

Create a one-shot timer (aka timeout).

Timeouts are processed in the following cases:

  • while waiting for a message using sys_timeouts_mbox_fetch()
  • by calling sys_check_timeouts() (NO_SYS==1 only)
Parameters
msecstime in milliseconds after that the timer should expire
handlercallback function to call when msecs have elapsed
argargument to pass to the callback function

Referenced by stdio_serial_init().