lwip-users
[Top][All Lists]
Advanced

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

RE : [lwip-users] Examples/Documentation Incorrect Timeout Code


From: Frédéric BERNON
Subject: RE : [lwip-users] Examples/Documentation Incorrect Timeout Code
Date: Mon, 27 Apr 2009 12:43:58 +0200

I suppose you use a old lwIP release. Can you tell us which one you use? Is your release provided by any company, or do you take it from the Savannah web site ?
 
 
====================================
Frédéric BERNON
HYMATOM SA
Chef de projet informatique
Microsoft Certified Professional
Tél. : +33 (0)4-67-87-61-10
Fax. : +33 (0)4-67-70-85-44
Email : address@hiddenr
Web Site : http://www.hymatom.fr 
====================================
P Avant d'imprimer, penser à l'environnement
-----Message d'origine-----
De : address@hidden [mailto:address@hidden De la part de HM2
Envoyé : lundi 27 avril 2009 12:06
À : Mailing list for lwIP users
Objet : [lwip-users] Examples/Documentation Incorrect Timeout Code

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.

Attachment: Frédéric BERNON.vcf
Description: Frédéric BERNON.vcf


reply via email to

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