Skip to content

Conversation

@Dirbaio
Copy link
Member

@Dirbaio Dirbaio commented Jan 14, 2022

This is the previous step to implementing both the embedded-hal 0.2 and embedded-hal 1.0 + embedded-hal-async traits.

The equivalent in nrf was done in #552

  • Removes need for unwrap in gpio.
  • Removes need for use embedded_hal::whatever in all cases.

@Dirbaio Dirbaio marked this pull request as draft January 14, 2022 21:02
@Dirbaio Dirbaio force-pushed the eh1 branch 2 times, most recently from 02f9585 to e3b01c6 Compare January 19, 2022 16:54
@Dirbaio Dirbaio changed the title wip: stm32: upgrade to embedded-hal 1.0 + embedded-hal-async stm32: expose all functionality as inherent methods. Jan 19, 2022
@Dirbaio Dirbaio marked this pull request as ready for review January 19, 2022 16:56
Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@Dirbaio
Copy link
Member Author

Dirbaio commented Jan 19, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 19, 2022

Build succeeded:

@bors bors bot merged commit 6b0cb06 into master Jan 19, 2022
@Dirbaio Dirbaio mentioned this pull request Feb 11, 2022
bors bot added a commit that referenced this pull request Feb 12, 2022
613: Rust stable support r=Dirbaio a=Dirbaio

This PR adds (limited) stable Rust support!

The drawbacks are: 

- No `#[embassy::task]`, `#[embassy::main]`. (requires `type_alias_impl_trait`). You have to manually allocate the tasks somewhere they'll live forever. See [example](https://github.com/embassy-rs/embassy/blob/master/examples/nrf/src/bin/raw_spawn.rs)
- No async trait impls (requires GATs). Note that the full API surface of HALs is still available through inherent methods: #552 #581 
- Some stuff is not constructible in const (requires `const_fn_trait_bound`), although there's an (ugly) workaround for the generic `Mutex`.

So it's not that bad in the end, it's fully usable for shipping production-ready firmwares. We'll still recommend nightly as the default, until GATs and `type_alias_impl_trait` are stable.

Co-authored-by: Dario Nieuwenhuis <[email protected]>
@Dirbaio Dirbaio deleted the eh1 branch March 14, 2022 17:58
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.

3 participants