-
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
PAC update #2378
PAC update #2378
Conversation
} | ||
|
||
/// Sets pull-up enable for the pin | ||
pub fn pullup_enable(&self, enable: bool) { | ||
get_pin_reg(PIN).modify(|_, w| w.fun_wpu().bit(enable)); |
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.
Might've been worth keeping the get_pin_reg
function still. 😅
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.
It's impossible if we use ::steal()
because it would return a reference to a local now. We don't have to use steal
, thoguh, but it looks better to my brain than random pointer dereferencing.
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.
but it looks better to my brain than random pointer dereferencing
Same 😄
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.
Straight forward change (beside GitHub's rendering of the diff 😢)
lp_io.[< pin $gpionum >]().modify(|_, w| { | ||
w.wakeup_enable().bit(wakeup).int_type().bits(level) | ||
$( | ||
impl $crate::gpio::RtcPin for GpioPin<$gpionum> { |
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.
With the new PAC update, this impl can be moved out of the macro. I'm hoping to see this in some future PR.
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.
That was one of the main motivators behind the relevant PAC change, and we're almost there.
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
Ripped out of #2359