|
From: | address@hidden |
Subject: | Re: [lwip-devel] Upgrading from v1.3.0 to 1.4.0 - sys_now() |
Date: | Mon, 16 May 2011 20:41:33 +0200 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 |
Phil Perryman wrote:
sys_now() is only referenced if NO_SYS==1 and LWIP_TIMERS==1. It is used by sys_check_timeouts() for an automatic timer implementation: previously, a NO_SYS==1 port had to call the various timer functions at the correct interval (e.g. tcp_tmr, etharp_tmr, ip_reass_tmr, etc.).I'm currently porting my Xilinx drivers from lwip 1.3.0 to 1.4.0 and have found that the latest version now uses a sys_now() function which was not used/needed previously. Why is this now needed
Now you may simply call sys_check_timeouts() in your main loop: no matter at which interval this function is called, it will know when to call which timers based on the return value of sys_now().
and what should the frequency of the returned timestamp be (assuming it is just a 32-bit count value)?
As the comment above the function declaration says, it should return milliseconds:
/** Returns the current time in milliseconds, * may be the same as sys_jiffies or at least based on it. */ Simon
[Prev in Thread] | Current Thread | [Next in Thread] |