Skip to content
Snippets Groups Projects
Commit bbb91f38 authored by Tomasz Wlostowski's avatar Tomasz Wlostowski
Browse files

userspace/libswitchhw/pps_gen.c: adjusting nanoseconds counter should re-scale...

userspace/libswitchhw/pps_gen.c: adjusting nanoseconds counter should re-scale from ns to clock cycles
parent 56150951
Branches
Tags
No related merge requests found
......@@ -54,7 +54,7 @@ int shw_pps_gen_adjust(int counter, int64_t how_much)
{
ppsg_write(ADJ_UTCLO, 0);
ppsg_write(ADJ_UTCHI, 0);
ppsg_write(ADJ_NSEC, how_much);
ppsg_write(ADJ_NSEC, (int32_t) ((int64_t) how_much * 1000LL / (int64_t)REF_CLOCK_PERIOD_PS));
} else {
ppsg_write(ADJ_UTCLO, (uint32_t ) (how_much & 0xffffffffLL));
ppsg_write(ADJ_UTCHI, (uint32_t ) (how_much >> 32) & 0xff);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment