]> rtime.felk.cvut.cz Git - lincan.git/blobdiff - lincan/include/main.h
CPC-PCI second chip IRQ corrected. Message timestamp code added.
[lincan.git] / lincan / include / main.h
index 4ef2b3e025aa1553d9a8a0925316812a1f990c08..4860694bab59f222b35c9f2b0205d1c0e9cb84cd 100644 (file)
@@ -480,6 +480,26 @@ const struct boardtype_t* boardtype_find(const char *str);
 
 int can_check_dev_taken(void *anydev);
 
 
 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*/
 #ifdef CAN_WITH_RTL
 extern int can_rtl_priority;
 #endif /*CAN_WITH_RTL*/