2015-09-07 21:57:04 +01:00
|
|
|
#include "ch.h"
|
|
|
|
|
|
|
|
|
|
#include "timer.h"
|
|
|
|
|
|
|
|
|
|
void timer_init(void) {}
|
|
|
|
|
|
|
|
|
|
void timer_clear(void) {}
|
|
|
|
|
|
|
|
|
|
uint16_t timer_read(void)
|
|
|
|
|
{
|
2018-11-07 07:08:08 +08:00
|
|
|
return (uint16_t)TIME_I2MS(chVTGetSystemTime());
|
2015-09-07 21:57:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t timer_read32(void)
|
|
|
|
|
{
|
2018-11-07 07:08:08 +08:00
|
|
|
return TIME_I2MS(chVTGetSystemTime());
|
2015-09-07 21:57:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint16_t timer_elapsed(uint16_t last)
|
|
|
|
|
{
|
2018-11-07 07:08:08 +08:00
|
|
|
return (uint16_t)(TIME_I2MS(chVTTimeElapsedSinceX(TIME_MS2I(last))));
|
2015-09-07 21:57:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t timer_elapsed32(uint32_t last)
|
|
|
|
|
{
|
2018-11-07 07:08:08 +08:00
|
|
|
return TIME_I2MS(chVTTimeElapsedSinceX(TIME_MS2I(last)));
|
2015-09-07 21:57:04 +01:00
|
|
|
}
|