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.c 449B

123456789101112131415161718192021222324252627
  1. #include "ch.h"
  2. #include "timer.h"
  3. void timer_init(void) {}
  4. void timer_clear(void) {}
  5. uint16_t timer_read(void)
  6. {
  7. return (uint16_t)ST2MS(chVTGetSystemTime());
  8. }
  9. uint32_t timer_read32(void)
  10. {
  11. return ST2MS(chVTGetSystemTime());
  12. }
  13. uint16_t timer_elapsed(uint16_t last)
  14. {
  15. return (uint16_t)(ST2MS(chVTTimeElapsedSinceX(MS2ST(last))));
  16. }
  17. uint32_t timer_elapsed32(uint32_t last)
  18. {
  19. return ST2MS(chVTTimeElapsedSinceX(MS2ST(last)));
  20. }