lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] sys_timeout firing too often.


From: Nick Thomas
Subject: RE: [lwip-users] sys_timeout firing too often.
Date: Fri, 5 Sep 2008 13:09:56 +0100


> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf
> Of Nick Thomas
> Sent: 05 September 2008 12:27
> To: Mailing list for lwIP users
> Subject: RE: [lwip-users] sys_timeout firing too often.
>
> On Fri, 2008-09-05 at 12:08 +0100, Nick Thomas wrote:
>
> >> The msec_to_tick appears to overflow with a large number (like
> 5000) - or
> am
> >> I wrong.
>
> > If that's the case then putting in a couple of brackets so the division
> > happens before the multiplication would solve the problem.
>
> >Kieran
>
> OK, so it becomes:
>
> //#define tick_to_msec(tick)  ((u32_t)((tick) * 1000 /
> time_ticks_per_sec()))
> #define tick_to_msec(tick)    ((u32_t)(((tick) /
> time_ticks_per_sec()) * 1000))
>
> //#define msec_to_tick(msec)  ((clock_t)((msec) * time_ticks_per_sec() /
> 1000))
> #define msec_to_tick(msec) ((clock_t)((msec) * (time_ticks_per_sec() /
> 1000)))
>
> I will give that a go. Thanks.

No, that still doesn't work.

However, I notice that the mdelay(msecs) function works;
If I do

printf("arp_timer\r\n");

        printf("Start...\r\n");
        start_time = time_now();
        mdelay(2000); // 2 seconds
        end_time = time_now();
        printf("End: Start = %d, End = %d (%d)\r\n", start_time, end_time,
end_time-start_time);

I see that the delay is roughly 2 seconds, and the ticks reported are
correct.

However, using sys_msleep(2000) in it's place doesn't work! it appears to
return after a random delay, but mostly after about  6250000 ticks (this
equates to 1 second on my box - surely no coincedence!).

Regards

Nick
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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