1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

fix: vtimer_now should return seconds and microseconds

This commit is contained in:
Christian Mehlis 2013-12-16 11:47:02 +01:00
parent 881593b981
commit cd016e0334

View File

@ -242,8 +242,10 @@ static int vtimer_set(vtimer_t *timer)
void vtimer_now(timex_t *out)
{
timex_t t = timex_set(seconds, hwtimer_now() - longterm_tick_start);
memcpy(out, &t, sizeof(timex_t));
uint32_t us = HWTIMER_TICKS_TO_US(hwtimer_now() - longterm_tick_start);
out->seconds = seconds + us / (1000 * 1000);
out->microseconds = us % (1000 * 1000);
}
int vtimer_init()