Skip to content

Commit

Permalink
Add zalepukha for ehal::v2 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
little-arhat committed May 12, 2019
1 parent 46b3bf4 commit 1ffe07c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use bobbin_bits::*;
use core::intrinsics::transmute;
use core::marker::PhantomData;
#[allow(deprecated)]
use hal::digital::{toggleable, InputPin, OutputPin, StatefulOutputPin};
use hal::digital::{toggleable, v2, InputPin, OutputPin, StatefulOutputPin};

/// Marker trait for any pin
pub trait GPIOPin {
Expand Down Expand Up @@ -512,6 +512,9 @@ macro_rules! gpio {
impl<PT: PullType, OT:OutputType, OS:OutputSpeed> toggleable::Default
for $PXi<PT, Output<OT, OS>> {}

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

#[allow(deprecated)]
impl<PT: PullType> InputPin for $PXi<PT, Input> {
fn is_high(&self) -> bool {
Expand Down
2 changes: 2 additions & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ pub use hal::blocking::spi::{
};
pub use hal::digital::v2::InputPin as _embedded_hal_digital_InputPin;
pub use hal::digital::v2::OutputPin as _embedded_hal_digital_OutputPin;
pub use hal::digital::v2::StatefulOutputPin as _embedded_hal_digital_StatefulOutputPin;
pub use hal::digital::v2::ToggleableOutputPin as _embedded_hal_digital_ToggleableOutputPin;
pub use hal::digital::v2_compat::*;
pub use hal::serial::Read as _embedded_hal_serial_Read;
pub use hal::serial::Write as _embedded_hal_serial_Write;
pub use hal::spi::FullDuplex as _embedded_hal_spi_FullDuplex;
Expand Down

0 comments on commit 1ffe07c

Please sign in to comment.