Commit 978b79c2 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

pps_gen,cmd_time: fix setting time with shell command

parent f14462b0
......@@ -67,7 +67,7 @@ int pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds)
ppsg_write(ADJ_UTCHI, (uint32_t ) (seconds >> 32) & 0xff);
ppsg_write(ADJ_NSEC, (int32_t) ((int64_t) nanoseconds * 1000LL / (int64_t)REF_CLOCK_PERIOD_PS));
ppsg_write(CR, ppsg_read(CR) | PPSG_CR_CNT_SET);
ppsg_write(CR, (ppsg_read(CR) & 0xfffffffb) | PPSG_CR_CNT_SET);
return 0;
}
......
......@@ -25,7 +25,7 @@ int cmd_time(const char *args[])
if(args[2] && !strcasecmp(args[0], "set")) {
if(wrc_ptp_get_mode() != WRC_MODE_SLAVE)
{
pps_gen_set_time(atoi(args[1]), atoi(args[2]) / 8);
pps_gen_set_time((uint64_t)atoi(args[1]), atoi(args[2]) / 8);
return 0;
} else
return -EBUSY;
......
Markdown is supported
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