diff --git a/rp2040-hal/Cargo.toml b/rp2040-hal/Cargo.toml index 696a109c9..789862c7a 100644 --- a/rp2040-hal/Cargo.toml +++ b/rp2040-hal/Cargo.toml @@ -18,8 +18,8 @@ targets = ["thumbv6m-none-eabi"] [dependencies] cortex-m = "0.7.2" embedded-hal = { version = "0.2.5", features = ["unproven"] } -eh1_0_alpha = { package = "embedded-hal", version = "=1.0.0-alpha.10", optional = true } -eh_nb_1_0_alpha = { package = "embedded-hal-nb", version = "=1.0.0-alpha.2", optional = true } +eh1_0_alpha = { package = "embedded-hal", version = "=1.0.0-alpha.11", optional = true } +eh_nb_1_0_alpha = { package = "embedded-hal-nb", version = "=1.0.0-alpha.3", optional = true } embedded-dma = "0.2.0" fugit = "0.3.6" itertools = { version = "0.10.1", default-features = false } diff --git a/rp2040-hal/src/spi.rs b/rp2040-hal/src/spi.rs index 999a4ade5..169009951 100644 --- a/rp2040-hal/src/spi.rs +++ b/rp2040-hal/src/spi.rs @@ -342,15 +342,7 @@ macro_rules! impl_write { } #[cfg(feature = "eh1_0_alpha")] - impl> eh1::SpiBusFlush for Spi { - fn flush(&mut self) -> Result<(), Self::Error> { - while self.is_busy() {} - Ok(()) - } - } - - #[cfg(feature = "eh1_0_alpha")] - impl> eh1::SpiBusRead<$type> for Spi { + impl> eh1::SpiBus<$type> for Spi { fn read(&mut self, words: &mut [$type]) -> Result<(), Self::Error> { for word in words.iter_mut() { // write empty word @@ -365,10 +357,7 @@ macro_rules! impl_write { } Ok(()) } - } - #[cfg(feature = "eh1_0_alpha")] - impl> eh1::SpiBusWrite<$type> for Spi { fn write(&mut self, words: &[$type]) -> Result<(), Self::Error> { for word in words.iter() { // write one word @@ -383,10 +372,7 @@ macro_rules! impl_write { } Ok(()) } - } - #[cfg(feature = "eh1_0_alpha")] - impl> eh1::SpiBus<$type> for Spi { fn transfer(&mut self, read: &mut [$type], write: &[$type]) -> Result<(), Self::Error>{ let len = read.len().max(write.len()); for i in 0..len { @@ -423,6 +409,11 @@ macro_rules! impl_write { Ok(()) } + + fn flush(&mut self) -> Result<(), Self::Error> { + while self.is_busy() {} + Ok(()) + } } #[cfg(feature = "eh1_0_alpha")]