From 8d5a829c75d38cbedd1b7398fc15b1bbd89a428e Mon Sep 17 00:00:00 2001 From: Rahix Date: Fri, 5 Jul 2024 23:24:05 +0200 Subject: [PATCH] Remove a superfluous trait bound that broke non-totem-pole devices There is no requirement for the hal trait implementations (`InputPin`, `OutputPin`, `StatefulOutputPin`) to require a `PortDriverTotemPole`. In fact, the presence of this bound means non-totem-pole devices no longer have hal trait implementations. Drop the superfluous bound to make non-totem-pole devices work again. Fixes: e7712de7745e ("feat: Update to embedded-hal 1.0.0") Reported-by: Thomas Riedler --- src/pin.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pin.rs b/src/pin.rs index 879584b..d6f4d14 100644 --- a/src/pin.rs +++ b/src/pin.rs @@ -1,5 +1,5 @@ use core::marker::PhantomData; -use embedded_hal::digital::{self as hal_digital, ErrorType}; +use embedded_hal::digital::{self as hal_digital}; /// Representation of a port-expander pin. /// @@ -71,9 +71,9 @@ impl From for PinError { } } -impl<'a, MODE, MUTEX, PD> ErrorType for Pin<'a, MODE, MUTEX> +impl<'a, MODE, MUTEX, PD> hal_digital::ErrorType for Pin<'a, MODE, MUTEX> where - PD: crate::PortDriver + crate::PortDriverTotemPole, + PD: crate::PortDriver, PD::Error: core::fmt::Debug, MUTEX: crate::PortMutex, { @@ -199,7 +199,7 @@ where impl<'a, MODE: crate::mode::HasInput, MUTEX, PD> hal_digital::InputPin for Pin<'a, MODE, MUTEX> where - PD: crate::PortDriver + crate::PortDriverTotemPole, + PD: crate::PortDriver, ::Error: core::fmt::Debug, MUTEX: crate::PortMutex, { @@ -258,7 +258,7 @@ where impl<'a, MODE: crate::mode::HasOutput, MUTEX, PD> hal_digital::OutputPin for Pin<'a, MODE, MUTEX> where - PD: crate::PortDriver + crate::PortDriverTotemPole, + PD: crate::PortDriver, ::Error: core::fmt::Debug, MUTEX: crate::PortMutex, { @@ -274,7 +274,7 @@ where impl<'a, MODE: crate::mode::HasOutput, MUTEX, PD> hal_digital::StatefulOutputPin for Pin<'a, MODE, MUTEX> where - PD: crate::PortDriver + crate::PortDriverTotemPole, + PD: crate::PortDriver, ::Error: core::fmt::Debug, MUTEX: crate::PortMutex, {