Skip to content

Updated digital traits for gpio to v2 #71

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

Merged
merged 1 commit into from
Sep 2, 2019
Merged

Conversation

MabezDev
Copy link
Member

Closes #63.

Not a massive fan on this change, I wish the ehal provided infallible traits that don't require unwraps on what is essentially volatile reads and writes in our case; but the warnings are very annoying so this gets rid of them.

@MabezDev MabezDev requested a review from nickray August 28, 2019 14:08
@nickray
Copy link
Member

nickray commented Aug 28, 2019

@MabezDev note that @Disasm is working on a v3 which should be better. i think the general idea is to have fallible and infallible traits more cleanly.

@MabezDev
Copy link
Member Author

I would prefer skipping v2 altogether to be honest, seems like a step backward in ergonomics. That said, I would like to publish a new release as it has been a while; is there a tracking issue for v3 traits? I did quick scan of embedded-hal and didn't spot anything.

@Disasm
Copy link
Member

Disasm commented Aug 28, 2019

There is no tracking issue or RFC yet. General idea is described here. If this works like expected, HALs will implement mostly v1 and drivers use v3.

@nickray
Copy link
Member

nickray commented Aug 28, 2019

The warnings are indeed very annoying, so I suggest we merge this and move back to v1 if/when the v3 is ready.

@Disasm
Copy link
Member

Disasm commented Aug 29, 2019

Is it possible to suppress the warnings instead?

@MabezDev
Copy link
Member Author

MabezDev commented Sep 2, 2019

@Disasm Dependant crates still get the warning though. Deciding to merge this, but will move to v3 asap.

@MabezDev MabezDev merged commit f51652d into master Sep 2, 2019
@nickray nickray deleted the upgrade-embedded-hal branch September 2, 2019 19:57
@MabezDev MabezDev restored the upgrade-embedded-hal branch September 2, 2019 19:59
@@ -249,14 +249,18 @@ macro_rules! gpio {
}

impl<MODE> OutputPin for $PXx<Output<MODE>> {
fn set_high(&mut self) {
type Error = ();
Copy link
Contributor

@hellow554 hellow554 Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the Error should either be Infallible, Void or !, but not ().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace embedded_hal::v1 with embedded_hal::v2
4 participants