summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2007-03-10 12:28:25 +0000
committerBarry Wardell <rockbox@barrywardell.net>2007-03-10 12:28:25 +0000
commitde061e8a304dd0f74c46201cf1bb4f542cedd15a (patch)
tree9cb73ba95bb022c71f079e11a204aaf04604efe1
parented40d3a65e302807c153c642c9bac325bcedd15a (diff)
downloadrockbox-de061e8a304dd0f74c46201cf1bb4f542cedd15a.tar.gz
rockbox-de061e8a304dd0f74c46201cf1bb4f542cedd15a.zip
Make udelay() wrap-safe.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12702 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/system.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 3c161a1e24..de1672ae8e 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -39,8 +39,8 @@ extern unsigned int ipod_hw_rev;
static inline void udelay(unsigned usecs)
{
- unsigned start = USEC_TIMER;
- while ((USEC_TIMER - start) < usecs);
+ unsigned stop = USEC_TIMER + usecs;
+ while (TIME_AFTER(USEC_TIMER, stop));
}
unsigned int current_core(void);