Skip to content

v2_compat does not provide shims for ToggleableOutputPin #137

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

Closed
little-arhat opened this issue May 12, 2019 · 0 comments · Fixed by #138
Closed

v2_compat does not provide shims for ToggleableOutputPin #137

little-arhat opened this issue May 12, 2019 · 0 comments · Fixed by #138

Comments

@little-arhat
Copy link
Contributor

error[E0599]: no method named `toggle` found for type `alt_stm32f30x_hal::gpio::PA1<alt_stm32f30x_hal::gpio::PullDown, alt_stm32f30x_hal::gpio::Output<alt_stm32f30x_hal::gpio::PushPull, alt_stm32f30x_hal::gpio::HighSpeed>>` in the current scope
  --> pin_sensors/main.rs:54:21
   |
54 |         let _ = pa1.toggle();
   |                     ^^^^^^
   |
   = note: the method `toggle` exists but the following trait bounds were not satisfied:
           `alt_stm32f30x_hal::gpio::PA1<alt_stm32f30x_hal::gpio::PullDown, alt_stm32f30x_hal::gpio::Output<alt_stm32f30x_hal::gpio::PushPull, alt_stm32f30x_hal::gpio::HighSpeed>> : embedded_hal::digital::v2::ToggleableOutputPin`
   = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope, perhaps add a `use` for it:
   |
6  | use embedded_hal::digital::v1::ToggleableOutputPin;

Can be solved in hal implementation by providing v2::toggleable implementation:

impl<PT: PullType, OT:OutputType, OS:OutputSpeed> v2::toggleable::Default
    for $PXi<PT, Output<OT, OS>> {}

But would be nice to have it provided by this crate.

little-arhat added a commit to little-arhat/embedded-hal that referenced this issue May 12, 2019
bors bot added a commit that referenced this issue May 13, 2019
138: Provide v2_compat for ToggleableOutputPin r=ryankurte a=little-arhat

fixes #137

Co-authored-by: Roma Sokolov <[email protected]>
little-arhat added a commit to little-arhat/embedded-hal that referenced this issue May 13, 2019
bors bot added a commit that referenced this issue May 14, 2019
138: Provide v2_compat for ToggleableOutputPin r=ryankurte a=little-arhat

fixes #137

Co-authored-by: Roma Sokolov <[email protected]>
@bors bors bot closed this as completed in #138 May 14, 2019
eldruin pushed a commit to eldruin/embedded-hal that referenced this issue Jun 10, 2020
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 a pull request may close this issue.

1 participant