]> git.friedersdorff.com Git - max/tmk_keyboard.git/blob - tmk_core/common/chibios/timer.c
3de4cc368bad9f82fa76544ec2b61c8970e580bb
[max/tmk_keyboard.git] / tmk_core / common / chibios / timer.c
1 #include "ch.h"
2
3 #include "timer.h"
4
5 void timer_init(void) {}
6
7 void timer_clear(void) {}
8
9 uint16_t timer_read(void)
10 {
11     return (uint16_t)ST2MS(chVTGetSystemTime());
12 }
13
14 uint32_t timer_read32(void)
15 {
16     return ST2MS(chVTGetSystemTime());
17 }
18
19 uint16_t timer_elapsed(uint16_t last)
20 {
21     return (uint16_t)(ST2MS(chVTTimeElapsedSinceX(MS2ST(last))));
22 }
23
24 uint32_t timer_elapsed32(uint32_t last)
25 {
26     return ST2MS(chVTTimeElapsedSinceX(MS2ST(last)));
27 }