freemyipod r295 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r294‎ | r295 | r296 >
Date:13:31, 28 November 2010
Author:theseven
Status:new
Tags:
Comment:
emBIOS: Define udelay as a macro to allow using it from within apps.
Modified paths:
  • /embios/trunk/timer.h (modified) (history)

Diff [purge]

Index: embios/trunk/timer.h
@@ -38,10 +38,10 @@
3939 #define USEC_TIMER (read_usec_timer())
4040
4141
42 -static inline void udelay(long duration) /* in usec steps */
43 -{
44 - long timestamp = USEC_TIMER;
45 - while (!TIMEOUT_EXPIRED(timestamp, duration));
 42+#define udelay(duration) \
 43+{ \
 44+ long timestamp = USEC_TIMER; \
 45+ while (!TIMEOUT_EXPIRED(timestamp, (long)(duration))); \
4646 }
4747
4848