-
Notifications
You must be signed in to change notification settings - Fork 221
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
GPIO Refactoring #1542
GPIO Refactoring #1542
Conversation
@@ -42,7 +42,7 @@ pub struct SystemTimer<'d, DM: crate::Mode> { | |||
pub alarm0: Alarm<Target, DM, 0>, | |||
pub alarm1: Alarm<Target, DM, 1>, | |||
pub alarm2: Alarm<Target, DM, 2>, | |||
_phantom: &'d PhantomData<()>, | |||
_phantom: PhantomData<&'d ()>, |
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.
unrelated to this PR but makes this ZST
// Begin configuring the TWAI peripheral. The peripheral is in a reset like | ||
// state that prevents transmission but allows configuration. | ||
let mut can_config = twai::TwaiConfiguration::new( | ||
let mut can_config = twai::TwaiConfiguration::new_no_transceiver( |
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.
don't really like it but probably not too bad
} | ||
|
||
/// Trait implemented by pins which can be used as outputs | ||
pub trait OutputPin: Pin { | ||
/// Configure open-drain mode | ||
fn set_to_open_drain_output(&mut self) -> &mut Self; | ||
fn set_to_open_drain_output(&mut self, _: private::Internal); |
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.
returning &mut Self
makes it inconvenient for delegation - since it's an internal API I don't think this is a problem
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 did initial review, overall looks really good! I left a few comments, some of them might not make any sense, so feel free to ignore them.
I will go through the changes again and I will test more examples as well.
Thanks for working on this!
739e382
to
29b5230
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.
LGTM, thank you very much!
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.
This is a really nice change! Thanks for looking into this, I only have one suggestion around adc, we could choose to address this in another PR if needed though.
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.
LGTM, thanks again for working on this!
Thank you for your contribution!
We appreciate the time and effort you've put into this pull request.
To help us review it efficiently, please ensure you've gone through the following checklist:
Submission Checklist 📝
CHANGELOG.md
in the proper section.Extra:
Pull Request Details 📖
Description
This is a huge PR with dramatic changes. I also have some ideas for a follow-up PR but I guess this is more than enough to review already.
Most probably this will need a migration-guide for the next release but probably best to wait for the review (and probably for a potential follow-up PR)
Testing
All examples and tests work