diff options
author | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-07-04 12:32:08 -0400 |
---|---|---|
committer | Christopher Browne <cbbrowne@ca.afilias.info> | 2016-07-04 12:32:08 -0400 |
commit | 2e1cfaf73fccdfaba2d7542f00bd7c3d49998d5d (patch) | |
tree | 9d8e9c6b71116f01c56c870a9e1071760899ff77 /tmk_core/common/chibios/timer.c | |
parent | 44a5f7630f18b40b36270d49449a43cd42b802f0 (diff) | |
parent | 9e01b219f32b0086728c10658928b8bffcc26ef7 (diff) |
Merge branch 'master' of https://github.com/jackhumbert/qmk_firmware
Diffstat (limited to 'tmk_core/common/chibios/timer.c')
-rw-r--r-- | tmk_core/common/chibios/timer.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tmk_core/common/chibios/timer.c b/tmk_core/common/chibios/timer.c new file mode 100644 index 0000000000..3de4cc368b --- /dev/null +++ b/tmk_core/common/chibios/timer.c @@ -0,0 +1,27 @@ +#include "ch.h" + +#include "timer.h" + +void timer_init(void) {} + +void timer_clear(void) {} + +uint16_t timer_read(void) +{ + return (uint16_t)ST2MS(chVTGetSystemTime()); +} + +uint32_t timer_read32(void) +{ + return ST2MS(chVTGetSystemTime()); +} + +uint16_t timer_elapsed(uint16_t last) +{ + return (uint16_t)(ST2MS(chVTTimeElapsedSinceX(MS2ST(last)))); +} + +uint32_t timer_elapsed32(uint32_t last) +{ + return ST2MS(chVTTimeElapsedSinceX(MS2ST(last))); +} |