-
Notifications
You must be signed in to change notification settings - Fork 139
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
Updating to embedded-hal digital::v2 #116
Conversation
nrf52-hal-common/src/gpio.rs
Outdated
@@ -62,7 +62,8 @@ use crate::target::P0; | |||
#[cfg(feature = "52840")] | |||
use crate::target::{ P1 }; | |||
|
|||
use crate::hal::digital::{OutputPin, StatefulOutputPin, InputPin}; | |||
use crate::hal::digital::v2::{OutputPin, StatefulOutputPin, InputPin}; | |||
use core::convert::Infallible; |
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.
Does using this increase our MSRV? IIRC this came in in 1.34.
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.
Great point. What is the MSRV you are targeting, and would reworking to use an error type of ()
instead of Infallible
be a solution?
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 don't know what the MSRV is, but if Infallible
needs to be replaced, it should be replaced with void::Void
, which is already a dependency of this crate.
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.
Awesome, I went ahead and replaced Infallible
with void::Void
.
Thank you for the pull request, @careyk007! I have one more nit-pick: You added Other than that, I think this is good to merge! |
Happy to help! Thanks for the great feedback! |
Thanks for the changes! Travis is failing. I think you're missing an import somewhere. Also, I was suggesting to re-export the |
Shoot! I'll look into the Travis issue. I can also re-export |
Looks good to, thanks! Also see #117 (comment). |
This is the simplest solution until a new HAL version is released that includes nrf-rs/nrf-hal#116.
I have updated the GPIO pins to use the embedded-hal v2 traits. I only have an Adafruit nRF52832 board so I haven't been able to test other chips, but since most of the changes were in
nrf52-hal-common
I am confident that this will work for other chips as well.