Skip to content
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

Migrate to embedded-hal 1.0.0-alpha.9 #38

Merged
merged 1 commit into from Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -24,7 +24,7 @@ xtensa-lx = { version = "0.6.0", optional = true }
spin = { version = "0.9.2", optional = true }
atomic-polyfill = { version = "0.1.6", optional = true }

embedded-hal-alpha = { package = "embedded-hal", version = "=1.0.0-alpha.8", optional = true }
embedded-hal-alpha = { package = "embedded-hal", version = "=1.0.0-alpha.9", optional = true }

[dev-dependencies]
embedded-hal-mock = "0.8"
Expand Down
8 changes: 4 additions & 4 deletions src/proxies.rs
Expand Up @@ -75,9 +75,9 @@ where
}

#[cfg(feature = "eh-alpha")]
impl<'a, M: crate::BusMutex> i2c_alpha::blocking::I2c for I2cProxy<'a, M>
impl<'a, M: crate::BusMutex> i2c_alpha::I2c for I2cProxy<'a, M>
where
M::Bus: i2c_alpha::blocking::I2c,
M::Bus: i2c_alpha::I2c,
{
fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> {
self.mutex.lock(|bus| bus.read(address, buffer))
Expand Down Expand Up @@ -120,14 +120,14 @@ where
fn transaction<'b>(
&mut self,
address: u8,
operations: &mut [i2c_alpha::blocking::Operation<'b>],
operations: &mut [i2c_alpha::Operation<'b>],
) -> Result<(), Self::Error> {
self.mutex.lock(|bus| bus.transaction(address, operations))
}

fn transaction_iter<'b, O>(&mut self, address: u8, operations: O) -> Result<(), Self::Error>
where
O: IntoIterator<Item = i2c_alpha::blocking::Operation<'b>>,
O: IntoIterator<Item = i2c_alpha::Operation<'b>>,
{
self.mutex
.lock(|bus| bus.transaction_iter(address, operations))
Expand Down