Merge pull request #430 from mehlis/vtimer-now-fix
fix: vtimer_now should return seconds and microseconds
This commit is contained in:
commit
01d62a52bc
@ -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()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user