Add can custom timing - #166
Merged
Merged
Conversation
ivmarkov
requested changes
Nov 18, 2022
| triple_sampling: false, | ||
| ..Default::default() | ||
| }, | ||
| Timing::Custom(twai_timing_config_t) => twai_timing_config_t, |
Collaborator
There was a problem hiding this comment.
Rather than exposing the ESP IDF C structure twai_timing_config_t can you implement a custom Rust structure - say - CustomTimingConfig and then also conversion implement code (might be just impl From<CustomTimingConfig> for twai_timing_config_t)?
Alternatively, and perhaps even better - you can implement the custom field members directly on the Custom variant of the Timing enum, and then impl From<Timing> for twai_timing_config_t?
Contributor
Author
There was a problem hiding this comment.
Sure, I added the custom field members directly on the Custom variant.
elotom
force-pushed
the
add-can-custom-timing
branch
from
November 18, 2022 12:14
3af7c7e to
eec65c3
Compare
elotom
force-pushed
the
add-can-custom-timing
branch
from
November 18, 2022 12:17
eec65c3 to
f22556c
Compare
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It would be nice if we could set custom CAN timings. I'm working on a project which uses a non-standard one.
This change requires deriving PartialEq and Eq for
twai_timing_config_t. I'll make an additional pull request for esp-idf-sys to fix the compilation issue.