-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix for issue #12104 (STM32 can_init_freq() ignores frequency) #12113
Conversation
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.
Fix looks correct, but looking at code I wonder why can_init
above doesn't just call can_init_freq(obj, rd, td, 100000)
, just as CAN_INIT_DIRECT
calls CAN_INIT_FREQ_DIRECT
.
@kjbracey-arm optimized |
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.
Looks good to me.
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.
CAN_INIT_DIRECT definition seems to be unused ?
You're half right - If the latter, then If the former, then no, we don't need So the macro magic of |
@mrpse - could you respond to comments above? |
Sorry, guys. I was off today. Generally, I agree with @kjbracey-arm. All Lines 70 to 73 in e2ee381
When the target is not ready for static pin-map then we are using the following weak direct functions (it simply calls regular init): Lines 76 to 85 in 9209b98
The problem is when the same HAL implementation is for targets that support and does not support static pin-map (like in this case). That is why we are using this trick with Regarding |
Dropped |
@mprse could you please add a little more detail to the summary of changes. For fixes we would expect to see a short summary of what the actual issue is and then some detail about how it has actually been fixed. This makes it much easier for people to see what has changed and why. Thanks. |
I have started the CI in the interim |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Updated PR description as requested. |
Summary of changes
This PR fixes issue #12104.
Currently
can_init_freq()/can_init_freq_direct()
ignores given frequency and sets default CAN frequency.This is a bug introduces while adding the static pin-map support for STM CAN. This PR fixes this problem and optimizes the code.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@jeromecoutant @bikeNomad