Commit 767b56cf authored by Miguel Jimenez Lopez's avatar Miguel Jimenez Lopez

irq-demo: Use gateware leap seconds if valid instead of kernel one

parent 6cd25a19
......@@ -227,6 +227,9 @@ int get_utc_ts_from_fmc_dio_device(fmc_dio_device dev, int ch,
struct usr_timestamp **ts, unsigned int *nts)
{
int ret;
int kernel_tai;
int usr_tai;
int usr_tai_valid;
int tai;
struct timespec *t;
......@@ -234,10 +237,17 @@ int get_utc_ts_from_fmc_dio_device(fmc_dio_device dev, int ch,
if(ret)
return ret;
tai = get_kernel_leaps_info(dev);
kernel_tai = get_kernel_leaps_info(dev);
for(int i = 0 ; i < *nts ; i++) {
t = &((*ts)[i].t);
usr_tai = (*ts)[i].leap_second;
#if defined(IGNORE_USR_LEAPSECOND)
usr_tai_valid = 0;
#else
usr_tai_valid = (*ts)[i].leap_second_valid;
#endif
tai = (usr_tai_valid) ? usr_tai : kernel_tai;
t->tv_sec -= tai;
}
......
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