timer_count32.h 388 B

1234567891011121314151617181920
  1. #ifndef _TIMER_COUNT32_H__
  2. #define _TIMER_COUNT32_H__
  3. #include "os/os_types.h"
  4. void timer_count32_init(void);
  5. u32 timer_count32_get(void);
  6. #define COUNT_CLK (200 * 1000)
  7. static __inline__ u32 timer_get_5us_ticks(u32 now, u32 count) {
  8. u32 delta = now - count;
  9. if (now < count) { //wrap
  10. delta = 0xFFFFFFFF - count + now + 1;
  11. }
  12. return (delta);
  13. }
  14. #endif /* _TIMER_COUNT32_H__ */