Skip to content

Conversation

@Sandyman
Copy link
Contributor

@Sandyman Sandyman commented Dec 2, 2019

In stead of assigning 0 directly to a timestamp member in canopen.pdo.Map, set it to None in the constructor, then check whether it exists before doing the subtraction in on_message. This way, we can potentially use other types for the timestamp, as long as subtracting two of them results in a float (meaning seconds).

… then check whether it exists before doing the subtraction. This way, we can potentially use other types for the timestamp, as long as subtracting two of them result in an integer/float (meaning seconds).
@Sandyman Sandyman changed the title In stead of assigning 0 directly to a timestamp member, make it None,… Allow for timestamps of other type than float/int. Dec 2, 2019
@Sandyman Sandyman changed the title Allow for timestamps of other type than float/int. Allow for timestamps of other types than float/int. Dec 2, 2019
@Sandyman Sandyman changed the title Allow for timestamps of other types than float/int. Allow for timestamps of other types than float Dec 2, 2019
@christiansandberg christiansandberg merged commit bb214a8 into canopen-python:master Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants