[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-users] Re: [lwip] timers in standalone app?
From: |
Adam Dunkels |
Subject: |
[lwip-users] Re: [lwip] timers in standalone app? |
Date: |
Wed, 08 Jan 2003 23:54:40 -0000 |
Hi Leon!
On Thursday 24 January 2002 16.10, you wrote:
> I lost it.
;-)
> In a stand-alone application, how would I use sys_timeout()?
>
> I see it enlists a timer, but who or what is responsible for managing
> the timers and handling timeouts?
>
> Should I be calling a certain function on a regular interval in order
> to drive the timers?
Timeouts are handled in the sys_sem_wait() and sys_mbox_fetch() functions
which in turn uses the sys_arch_sem_wait() and sys_arch_mbox_fetch()
functions. If you are running lwIP in a single threaded environment, the
latter of those functions can be implemented as a simple "wait for n
milliseconds" function. Look in src/arch/6502/sys_arch.c for an example of
such an implementation.
It is also quite possible to run without using the sys_timeout() feature at
all, and just call the timer functions at the correct time. I think this is
how Florian's Win32 port works (right Florian?).
/adam
--
Adam Dunkels <address@hidden>
http://www.sics.se/~adam
[This message was sent through the lwip discussion list.]