X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/blobdiff_plain/b47c0a55a3721e635d5b28f61a46161f72894394..3a2bb63f0bb8de2aafb346b53b945c59b3f87a41:/lincan/include/main.h diff --git a/lincan/include/main.h b/lincan/include/main.h index 4ef2b3e..4860694 100644 --- a/lincan/include/main.h +++ b/lincan/include/main.h @@ -480,6 +480,26 @@ const struct boardtype_t* boardtype_find(const char *str); int can_check_dev_taken(void *anydev); +#if defined(can_gettimeofday) && defined(CAN_MSG_VERSION_2) && 1 +static inline +void can_filltimestamp(canmsg_tstamp_t *ptimestamp) +{ + can_gettimeofday(ptimestamp); +} +#else /* No timestamp support, set field to zero */ +static inline +void can_filltimestamp(canmsg_tstamp_t *ptimestamp) +{ + #ifdef CAN_MSG_VERSION_2 + ptimestamp->tv_sec = 0; + ptimestamp->tv_usec = 0; + #else /* CAN_MSG_VERSION_2 */ + *ptimestamp = 0; + #endif /* CAN_MSG_VERSION_2 */ + +} +#endif /* End of timestamp source selection */ + #ifdef CAN_WITH_RTL extern int can_rtl_priority; #endif /*CAN_WITH_RTL*/