Thanks for the reply chrysn,

I am using No OS, I have inserted LwIP code into stm32L using IAR compiler,
my sys_now() is working fine as I am using Hardware Timer(Systick timer)
and it is producing proper milliseconds.

The problem--> sys_timeout() was calling handler function immediately. Is
fixed now.

I have now fixed the problem using sys_restart_timeouts() before
sys_timeout(), sys_restart_timeouts() sets back the timestamp of the last
call to sys_check_timeouts(). Thus after 1000 milliseconds, I get called
the handler function (Just what I needed).

I am using this timeout in getting Request Timeout prints in ping.c.
On 20-Oct-2013 9:24 AM, "chrysn [via lwIP]" <
[email protected]> wrote:

> On Wed, Oct 09, 2013 at 11:41:50PM -0700, Ishmeet wrote:
> > I am using LwIP 1.4.1, the problem is I have to use sys_timeouts(), for
> "Ping
> > Request Timed out" prints inside ping.c. When I send ping requests using
> > ping_send_now(). I call sys_timeout(1000, ping_timeout, ping_pcb); along
> > with it. The problem is ping_timeout handler calls immediately after
> calling
> > sys_timeout, rather it should call after 1000 msec as described.
>
> what are you using to handle timeouts? do you use an operating system
> (which?) or are you in NO_SYS=1 mode? if NO_SYS=1, is your sys_now()
> function reliably producing milliseconds?
>
> best regards
> chrysn
>
> --
> To use raw power is to make yourself infinitely vulnerable to greater
> powers.
>   -- Bene Gesserit axiom
>
> _______________________________________________
> lwip-users mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=21967&i=0>
> https://lists.nongnu.org/mailman/listinfo/lwip-users
>
> *signature.asc* (853 bytes) Download 
> Attachment<http://lwip.100.n7.nabble.com/attachment/21967/0/signature.asc>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://lwip.100.n7.nabble.com/Sys-Timeout-Calling-Handler-Immediately-tp21956p21967.html
>  To unsubscribe from Sys_Timeout(); Calling Handler Immediately?, click
> here<http://lwip.100.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=21956&code=SXNobWVldHNpbmdoaXNAZ21haWwuY29tfDIxOTU2fC03OTM5NDA1MzE=>
> .
> NAML<http://lwip.100.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://lwip.100.n7.nabble.com/Sys-Timeout-Calling-Handler-Immediately-tp21956p21968.html
Sent from the lwip-users mailing list archive at Nabble.com.
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to