diff --git a/src/gpio.rs b/src/gpio.rs index c88946458..4516645ae 100644 --- a/src/gpio.rs +++ b/src/gpio.rs @@ -206,9 +206,8 @@ macro_rules! gpio { } } - #[cfg(feature = "unproven")] - impl InputPin for PXx> { + impl InputPin for PXx> { type Error = Infallible; fn is_high(&self) -> Result { @@ -425,7 +424,7 @@ macro_rules! gpio { } #[cfg(feature = "unproven")] - impl InputPin for $PXx> { + impl InputPin for $PXx> { type Error = Infallible; fn is_high(&self) -> Result { @@ -439,7 +438,7 @@ macro_rules! gpio { } #[cfg(feature = "unproven")] - impl InputPin for $PXx> { + impl InputPin for $PXx> { type Error = Infallible; fn is_high(&self) -> Result { @@ -625,7 +624,7 @@ macro_rules! gpio { } #[cfg(feature = "unproven")] - impl InputPin for $PXi> { + impl InputPin for $PXi> { type Error = Infallible; fn is_high(&self) -> Result { @@ -634,12 +633,12 @@ macro_rules! gpio { fn is_low(&self) -> Result { // NOTE(unsafe) atomic read with no side effects - Ok(unsafe { (*$GPIOX::ptr()).idr.read().bits() & (1 << $i) == 0 }) + Ok(unsafe { (*$GPIOX::ptr()).idr.read().$idri().is_low()}) } } #[cfg(feature = "unproven")] - impl InputPin for $PXi> { + impl InputPin for $PXi> { type Error = Infallible; fn is_high(&self) -> Result {