From de061e8a304dd0f74c46201cf1bb4f542cedd15a Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Sat, 10 Mar 2007 12:28:25 +0000 Subject: [PATCH] Make udelay() wrap-safe. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12702 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/system.h | 4 ++-- 1 file 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);