-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement MCAN shutdown by writing to CSR #45
Conversation
67a7cd1
to
5cd247c
Compare
Looks great @Ironedde! Just some nits about the documentation and terminology, but otherwise it 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.
Looks good! Agree with all comments from @epontan, like changing the name of "shutdown" to "power down mode", or possibly "sleep mode", to be consistent with the official documentation.
I'll try to come up with some suggestion for a high level description for ready_for_shutdown
.
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.
Looks great, @Ironedde! Just a few remaining nits, otherwise LGTM 👍
We should perhaps create a commit before this which allows |
@epontan I totally agree, I'm on it. I also found out why we haven't gotten any annotations on the code when clippy failed. I'll rename my fork after this PR chain. |
MCAN can safely be shut down by writing to the `CCCR.CSR` register (Clock Stop Request) and then waiting for `CCCR.CSA` (Clock Stop Acknowledge) to become high. This will not interrupt any ongoing transmissions/receptions and is therefore deemed the safe way to shut down the bus. Note: It is not stated directly, but testing has shown that issuing a stop request will only wait for the currently ongoing transmissions and not what is queued. These messages will be sent once we enter operational mode again.
2c96ce4
to
794b91b
Compare
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.
Nice! LGTM 👍
- Add safe way to shutdown the bus when actively transmitting/receiving (GrepitAB#45) - Add method to finalize configuration into initialization mode (GrepitAB#47) - *Breaking* Update the register mappings with svd2rust 0.30.2 and form 0.10.0 (GrepitAB#46)
- Add safe way to shutdown the bus when actively transmitting/receiving (GrepitAB#45) - Add method to finalize configuration into initialization mode (GrepitAB#47) - *Breaking* Update the register mappings with svd2rust 0.30.2 and form 0.10.0 (GrepitAB#46)
MCAN can safely be shut down by writing to the
CCCR.CSR
register(Clock Stop Request) and then waiting for
CCCR.CSA
(Clock StopAcknowledge) to become high.
This will not interrupt any ongoing transmissions/receptions and is
therefore deemed the safe way to shut down the bus.
Note: It is not stated directly, but testing has shown that issuing a
stop request will only wait for the currently ongoing transmissions
and not what is queued. These messages will be sent once we enter
operational mode again.
Thank you!
Thank you for your contribution.
Please make sure that your submission includes the following:
Must
errors
orwarnings
.cargo +stable fmt
was run.cargo +stable clippy
yields nowarnings
.CHANGELOG.md
in the proper section.newly added features and code.