+#ifndef CONFIG_TIMER_DISABLE_UDELAY
+
+/**
+ * Busy wait until the specified amount of high-precision ticks have elapsed.
+ *
+ * \note This function is interrupt safe, the only
+ * requirement is a running hardware timer.
+ */
+void timer_busyWait(hptime_t delay)
+{
+ hptime_t now, prev = timer_hw_hpread();
+ hptime_t delta;
+
+ for(;;)
+ {
+ now = timer_hw_hpread();
+ /*
+ * We rely on hptime_t being unsigned here to
+ * reduce the modulo to an AND in the common
+ * case of TIMER_HW_CNT.
+ */
+ delta = (now - prev) % TIMER_HW_CNT;
+ if (delta >= delay)
+ break;
+ delay -= delta;
+ prev = now;
+ }
+}
+
+/**
+ * Wait for the specified amount of time (expressed in microseconds).