relationship of timestamp / timer functions
Hello,
which corresponding functions do i have to use when i try to get the correct timediff between two events. Especially i get an timestamp with every CAN Message (wich is implemented with rtdm_clock_read())and on the other side i get a timestamp in my Userspace application with rt_timer_tsc(). Are they are running at the same base so that i can use the difference of both returned values of the functions?
Axel
Quoted 8 lines · Axel Beierlein
Hello,
which corresponding functions do i have to use when i try to get the correct timediff between two events. Especially i get an timestamp with every CAN Message (wich is implemented with rtdm_clock_read())and on the other side i get a timestamp in my Userspace application with
rt_timer_tsc(). Are they are running at the same base so that i can use the difference of both returned values of the functions?
rt_timer_read() corresponds to rtdm_clock_read(), but rt_timer_read() returns the date as a count of clock ticks whereas rtdm_clock_read() returns the date as a count of nanoseconds. So, if you are running in periodic mode, you should compare CAN message timestamps with rt_timer_ticks2ns(rt_timer_read()), if you are running in aperiodic mode, rt_timer_ticks2ns simply returns the same value, so you can directly compare the value returned by rtdm_clock_read() and rt_timer_read().
Signature · 1 line
Gilles Chanteperdrix