lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Upgrading from v1.3.0 to 1.4.0 - sys_now()


From: Phil Perryman
Subject: Re: [lwip-devel] Upgrading from v1.3.0 to 1.4.0 - sys_now()
Date: Tue, 17 May 2011 02:54:07 -0700 (PDT)

Ok, I have changed my timer interrupt to increment a count value evey
millisecond and added a sys_now function which returns the value.  Main.c
now calls sys_check_timeouts every iteration.  However in order to save CPU
cycles, does the interrupt need to be triggered every millisecond or can it
be for example every 250ms (obviously incrementing by 250 each time it's
called)?

Phil


Simon Goldschmidt wrote:
> 
> Phil Perryman wrote:
>> 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
> 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.).
> 
> 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
> 
> _______________________________________________
> lwip-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-devel
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Upgrading-from-v1.3.0-to-1.4.0---sys_now%28%29-tp31628186p31636357.html
Sent from the lwip-devel mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]