Skip to content

Commit 983a8f3

Browse files
committed
Change Message Timestamp for IXXAT to float. Closes #79
1 parent cff4b1c commit 983a8f3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

can/interfaces/ixxat/canlib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,13 @@ def __init__(self, channel, can_filters=None, **config):
241241
self.CHANNEL_BITRATES[1][bitrate]
242242
)
243243
_canlib.canControlGetCaps(self._control_handle, ctypes.byref(self._channel_capabilities))
244+
244245
# With receive messages, this field contains the relative reception time of
245246
# the message in ticks. The resolution of a tick can be calculated from the fields
246-
# dwClockFreq and dwTscDivisor of the structure CANCAPABILITIES in accor-
247-
# dance with the following formula:
248-
# Resolution [s] = dwTscDivisor / dwClockFreq
249-
# Reversed the terms, so that we have the number of ticks in a second
250-
self._tick_resolution = self._channel_capabilities.dwClockFreq / self._channel_capabilities.dwTscDivisor
247+
# dwClockFreq and dwTscDivisor of the structure CANCAPABILITIES in accordance with the following formula:
248+
# frequency [1/s] = dwClockFreq / dwTscDivisor
249+
# We explicitly cast to float for Python 2.x users
250+
self._tick_resolution = float(self._channel_capabilities.dwClockFreq / self._channel_capabilities.dwTscDivisor)
251251

252252
# Setup filters before starting the channel
253253
if can_filters is not None and len(can_filters):

0 commit comments

Comments
 (0)