lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Examples/Documentation Incorrect Timeout Code


From: HM2
Subject: [lwip-users] Examples/Documentation Incorrect Timeout Code
Date: Mon, 27 Apr 2009 03:06:29 -0700

I think there is a mistake in the examples and documentation.
There are many places where timeouts are given as below:

if ( (clock()-last_arp_time) >= (ARP_TMR_INTERVAL * CLOCK_MS) )
Assuming that clock() and last_arp_time are given as ticks,
and assuming that ARP_TMR_INTERVAL is going to be given in mSec,
and CLOCK_MS is the number of mSec/tick, then the above is incorrect.
The units would be: (ticks-ticks = mSec * mSec/Tick)     That's wrong.
The correct formula should be:

if ( (clock()-last_arp_time) >= (ARP_TMR_INTERVAL / CLOCK_MS) )
The units are: (ticks-ticks = mSec * ticks/mSec)  or (ticks = ticks)
Chris.

reply via email to

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