New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unify bit timings with separate class for CAN FD #1468
Conversation
76ef38d
to
50b9d50
Compare
9995163
to
81f44e1
Compare
a047dc8
to
35dd96d
Compare
Thank you @zariiii9003, the proposal sounds very reasonable! I am honestly not that much of an expert with the bit timing mechanisms, so I'll retreat from this discussion. But at a glance, this looks like a very useful contribution. |
This looks impressive! I will look through the code over the next day or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a few comments with things to came to my mind. I can also support with writing further tests if necessary or with doing manual tests of the Peak interface when this PR is merged.
Co-authored-by: Lukas Magel <luke-mail@online.de>
Co-authored-by: Lukas Magel <luke-mail@online.de>
Co-authored-by: Lukas Magel <luke-mail@online.de>
@hardbyte I'll wait for your approval, since this is a quite a big change. |
# Conflicts: # test/test_util.py
I will merge this in a few days if there are no objections |
This is a continuation of #614 and #615. I would like to hear your opinions before i waste my time on writing tests and docs.
I made the following changes:
__init__
methodBitTiming(**kwargs)
,BitTiming.from_registers(**kwargs)
andBitTiming.from_sample_point(**kwargs)
typing.Mapping
. Now the user can calldict(timing)
to get a dictionary of the bit timing parameters. This should make it easier to save the parameters to a config file.Interface implementations should add a single parameter like
timing: Union[BitTiming, BitTimingFd]
. It would take precedence over other parameters and provide a simple API for the user. The docstring of the parameter should tell the users which values forf_clock
are accepted.