summaryrefslogtreecommitdiffstats
path: root/tmk_core/common/chibios/timer.c
blob: 3de4cc368bad9f82fa76544ec2b61c8970e580bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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)));
}