Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

timer.h 295B

1234567891011121314151617
  1. #ifndef TIMER_H
  2. #define TIMER_H 1
  3. #include <stdint.h>
  4. #define TIMER_DIFF(a, b) ((a) >= (b) ? (a) - (b) : UINT16_MAX - (b) + (a))
  5. extern volatile uint16_t timer_count;
  6. void timer_init(void);
  7. void timer_clear(void);
  8. uint16_t timer_read(void);
  9. uint16_t timer_elapsed(uint16_t last);
  10. #endif