Merge branch 'master' into radar
[carl9170fw.git] / carlfw / include / timer.h
index 7e4cb4cd69a2a5a4bebac5a8f4b38f206b7e1fd9..0464914091353f30eb7029e4be0453250b283713 100644 (file)
@@ -47,7 +47,12 @@ static inline __inline uint32_t get_clock_counter(void)
  */
 static inline __inline bool is_after_msecs(const uint32_t t0, const uint32_t msecs)
 {
-       return ((get_clock_counter() - t0) / 1000) > (msecs * fw.ticks_per_msec);
+       return ((get_clock_counter() - t0) / 1000) > (msecs * fw.ticks_per_usec);
+}
+
+static inline __inline bool is_after_usecs(const uint32_t t0, const uint32_t usecs)
+{
+       return ((get_clock_counter() - t0)) > (usecs * fw.ticks_per_usec);
 }
 
 /*
@@ -60,7 +65,7 @@ static inline __inline void delay(const uint32_t msec)
 {
        uint32_t t1, t2, dt, wt;
 
-       wt = msec * fw.ticks_per_msec;
+       wt = msec * fw.ticks_per_usec;
 
        t1 = get_clock_counter();
        while (1) {
@@ -79,7 +84,7 @@ static inline __inline void udelay(const uint32_t usec)
        while (1) {
                t2 = get_clock_counter();
                dt = (t2 - t1);
-               if (dt >= (usec * fw.ticks_per_msec))
+               if (dt >= (usec * fw.ticks_per_usec))
                        break;
        }
 }