Skip to content

Commit

Permalink
Update to embedded-hal-async 0.2.0-alpha.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeaurivage committed May 4, 2023
1 parent adc5897 commit 7682771
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ void = {version = "1.0", default-features = false}

cortex-m-interrupt = {version = "0.2.1-git", git = "https://github.com/datdenkikniet/cortex-m-interrupt.git", rev = "9baa936", optional = true}
defmt = { version = "0.3", optional = true}
embassy-sync = {version = "0.1", optional = true}
embassy-sync = {version = "0.2", optional = true}
embedded-hal-alpha = {package = "embedded-hal", version = "1.0.0-alpha.9"}
embedded-hal-async = {version = "0.2.0-alpha.0", optional = true}
embedded-hal-async = {version = "0.2.0-alpha.1", optional = true}
embedded-sdmmc = {version = "0.3", optional = true}
fugit = {version = "0.3", optional = true}
futures = {version = "0.3", default-features = false, features = ["async-await"], optional = true}
Expand Down
9 changes: 2 additions & 7 deletions hal/src/async_hal/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,24 +170,19 @@ where
mod impl_ehal {
use super::*;
use crate::time::U32Ext;
use core::convert::Infallible;
use embedded_hal_async::delay::DelayUs;

impl<T, I> DelayUs for TimerFuture<T, I>
where
T: AsyncCount16,
I: InterruptNumber,
{
type Error = Infallible;

async fn delay_ms(&mut self, ms: u32) -> Result<(), Self::Error> {
async fn delay_ms(&mut self, ms: u32) {
self.delay(ms.ms()).await;
Ok(())
}

async fn delay_us(&mut self, us: u32) -> Result<(), Self::Error> {
async fn delay_us(&mut self, us: u32) {
self.delay(us.us()).await;
Ok(())
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions hal/src/sercom/i2c/async_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ mod impl_ehal {
}

#[inline]
async fn transaction<'a, 'b>(
&'a mut self,
async fn transaction<'mut_self, 'a, 'b>(
&'mut_self mut self,
address: u8,
operations: &'a mut [embedded_hal_async::i2c::Operation<'b>],
) -> Result<(), Self::Error> {
Expand Down Expand Up @@ -323,8 +323,8 @@ mod impl_ehal {
}

#[inline]
async fn transaction<'a, 'b>(
&'a mut self,
async fn transaction<'mut_self, 'a, 'b>(
&'mut_self mut self,
address: u8,
operations: &'a mut [embedded_hal_async::i2c::Operation<'b>],
) -> Result<(), Self::Error> {
Expand Down

0 comments on commit 7682771

Please sign in to comment.