+
+
+//TODO: take care of slow timers so add convertions for seconds to ticks and viceversa.
+
+/*! Convert \a ms [ms] to ticks */
+INLINE ticks_t ms_to_ticks(mtime_t ms)
+{
+ return ms * TIMER_TICKS_PER_MSEC;
+}
+
+/*! Convert \a us [us] to ticks */
+INLINE ticks_t us_to_ticks(utime_t us)
+{
+#if TIMER_TICKS_PER_MSEC < 10000
+ return (us * TIMER_TICKS_PER_MSEC + 500) / 1000;
+#else
+ return (us * TIMER_TICKS_PER_USEC);
+#endif
+}
+
+/*! Convert \a ticks [ticks] to ms */
+INLINE mtime_t ticks_to_ms(ticks_t ticks)
+{
+ return (ticks + TIMER_TICKS_PER_MSEC / 2) / TIMER_TICKS_PER_MSEC;
+}
+
+/*! Convert \a ticks [ticks] to us */
+INLINE utime_t ticks_to_us(ticks_t ticks)
+{
+#if TIMER_TICKS_PER_USEC > 10
+ return (ticks / TIMER_TICKS_PER_USEC);
+#else
+ return (ticks * 1000 + TIMER_TICKS_PER_MSEC / 2) / TIMER_TICKS_PER_MSEC;
+#endif
+}
+
+/*! Convert \a us [us] to hpticks */
+INLINE hptime_t us_to_hptime(utime_t us)