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:
parent
881593b981
commit
cd016e0334
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user