japaric / f3

Board Support Crate for the STM32F3DISCOVERY
Apache License 2.0
94 stars 35 forks source link

Replace deprecated `hal::prelude::_embedded_hal_digital_OutputPin` with embedded_hal #107

Closed quietlychris closed 5 years ago

quietlychris commented 5 years ago

First, apologies for any inconsistencies with this pull request--this is my first time trying to make any changes to a crate, so I'd really appreciate both your patience and any advice you might have. I'm also fairly new to embedded in general, so there's a good chance this is more than a little rough.

This pull request replaces the deprecated hal::prelude::_embedded_hal_digital_OutputPin struct with the embedded_hal::digital::v2::OutputPin struct instead. The now-required Result is consumed by an assert_eq!() statement to prevent an error due to the #![deny(warnings)] flag, which appears in the blinky, leds, and roulette examples.

I'm not sure if the result is supposed to look like Result<(),()> or not, but since the Implementor I see in the docs says type Error = () and it compiles, I thought that might make sense. I'm also not sure that using assert_eq!() is the most idiomatic way of doing error handling in this case, so any guidance there would be appreciated as well.

I believe this solves the issue referenced in this comment.

quietlychris commented 5 years ago

Actually, it looks like pull request #109 take care of the issues this was meant to address in a more comprehensive way; closing in favor of that one..