Merge pull request #430 from mehlis/vtimer-now-fix

fix: vtimer_now should return seconds and microseconds
This commit is contained in:
Oleg Hahm 2014-01-15 09:10:29 -08:00
commit 01d62a52bc

View File

@ -255,8 +255,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()