@Younger: There is no function like 'main_thread' in the lwip source!
What you have to do is
a) provide a timeouts structure per thread, sys_arch_timeouts() must
return a unique structure for the currently running thread
b) provide the correct wait-time return values for sys_arch_sem_wait()
and sys_arch_mbox_fetch()
sys_sem_wait() and sys_mbox_fetch() will call the timeout handlers when
enough time has passed waiting for semaphores/mboxes. The protocol
timers are initialized in tcpip_init(), from v1.3.0 on you just have to
call lwip_init().
The downside of this timer-approach is that timers are not really
accurate when processor load is high in the tcpip_thread (active time
vs. wait time) or if you never really wait much at all on sems/mboxes.
There is a task on savannah for this to be implemented better (also for
NO_SYS=1 which currently can't use the timeouts) but for now, this is
how you have to do it.
Simon
John Kennedy wrote:
Hi,
I'm porting lwip using an RTOS and sockets, but I'm not certain what I have to
do about timers.
Using an RTOS do I need to periodically call any timer functions within lwip
like etharp_tmr, tcp_tmr, dns_tmr, dhcp_coarse_tmr, dhcp_fine_tmr,
ip_reass_tmr, igmp_tmr, autoip_tmr?
Thanks,
John
_______________________________________________
lwip-users mailing list
lwip-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users