[En-Nut-Discussion] NutGetTickClock rounding (again)

Henrik Maier hmlists at focus-sw.com
Wed Jul 16 04:02:13 CEST 2008


I agree, then let's implement it. 

Henrik

274 static inline unsigned long msecs_to_jiffies(const unsigned int m)
275 {
276         if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
277                 return MAX_JIFFY_OFFSET;
278 #if HZ <= MSEC_PER_SEC && !(MSEC_PER_SEC % HZ)
279         return (m + (MSEC_PER_SEC / HZ) - 1) / (MSEC_PER_SEC / HZ);
280 #elif HZ > MSEC_PER_SEC && !(HZ % MSEC_PER_SEC)
281         return m * (HZ / MSEC_PER_SEC);
282 #else
283         return (m * HZ + MSEC_PER_SEC - 1) / MSEC_PER_SEC;
284 #endif
285 }

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of duane ellis
> Sent: Tuesday, 15 July 2008 9:38 PM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] NutGetTickClock rounding (again)
> 
> The issues with this are well explained and well documented here,
> including ways to solve the problem.
> 
> http://www.gelato.unsw.edu.au/lxr/source/include/linux/jiffies.h
> 
> Lines 1 to 299.
> 
> -Duane.
> 
> 
> 
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list