-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Kieran Mansley Sent: 05 September 2008 12:18 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. _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
