lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #5785] Integrate SNMP initialization in tcpip.c


From: Frédéric Bernon
Subject: [lwip-devel] [patch #5785] Integrate SNMP initialization in tcpip.c
Date: Mon, 12 Mar 2007 14:02:28 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2

Follow-up Comment #17, patch #5785 (project lwip):

> "to add sys_arch_get_tickcount() and two functions (or macros) for
conversation ticks to or from milliseconds. "

To avoid these kind of problems, and got a ms value, I use functions like
this (is it in the same spirit of your idea???) :

/*-----------------------------------------------------------------------------------*/
/* Public sys_arch tool */
/* Returns current tickcount */
u32_t sys_start_tickcount()
{ UInt32 ulTickCount = 0;
  tmbslCoreGetTickCount(&ulTickCount);  
  return ulTickCount;
}

/*-----------------------------------------------------------------------------------*/
/* Public sys_arch tool */
/* Returns current number of milliseconds from "tickcount" parameter */
u32_t sys_stop_tickcount( u32_t tickcount)
{ UInt32 ulTickCount = 0;
  tmbslCoreGetTickCount(&ulTickCount);  
  if (ulTickCount>=tickcount) 
   { return ((ulTickCount-tickcount)             /ulTicksPerMilliSec);
   }
  else
   { return (((0xffffffff-tickcount)+ulTickCount)/ulTicksPerMilliSec);
   }
}

I don't use that, but I suppose it will help :

/* Public sys_arch tool */
/* Returns current number of milliseconds between "old" and "new" parameters
*/
u32_t sys_diff_tickcount( u32_t oldtickcount, u32_t newtickcount)
{ if (newtickcount>=oldtickcount) 
   { return ((newtickcount-oldtickcount)             /ulTicksPerMilliSec);
   }
  else
   { return (((0xffffffff-oldtickcount)+newtickcount)/ulTicksPerMilliSec);  
}
}



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?5785>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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