Index: firmware/export/system.h =================================================================== --- firmware/export/system.h (revision 12552) +++ firmware/export/system.h (working copy) @@ -40,7 +40,15 @@ static inline void udelay(unsigned usecs) { unsigned start = USEC_TIMER; - while ((USEC_TIMER - start) < usecs); + while ((USEC_TIMER - start) < usecs) + { + /* Deal with wrapping */ + if (USEC_TIMER < start) + { + usecs += ((UINT_MAX - start); + start = 0; + } + } }