Skip to content

Commit

Permalink
Fix dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeaurivage committed Dec 1, 2023
1 parent 223ca81 commit b6d7f32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
2 changes: 1 addition & 1 deletion hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ nb = "1.0"
num-traits = {version = "0.2.14", default-features = false}
opaque-debug = "0.3.0"
paste = "1.0.11"
portable-atomic = {version = "1.5.0", optional = true, default-features = false}
portable-atomic = {version = "1.5.0", optional = true, default-features = false, features = ["critical-section"]}
rand_core = "0.6"
seq-macro = "0.3"
typenum = "1.12.0"
Expand Down
27 changes: 8 additions & 19 deletions hal/src/async_hal/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use core::{
use cortex_m::interrupt::InterruptNumber;
use cortex_m_interrupt::NvicInterruptRegistration;
use embassy_sync::waitqueue::AtomicWaker;
use fugit::{MicrosDurationU32, MillisDurationU32, NanosDurationU32};
use fugit::NanosDurationU32;
use portable_atomic::AtomicBool;

#[cfg(feature = "thumbv6")]
Expand Down Expand Up @@ -164,24 +164,13 @@ where
}
}

mod impl_ehal {
use super::*;
use embedded_hal_async::delay::DelayUs;

impl<T, I> DelayUs for TimerFuture<T, I>
where
T: AsyncCount16,
I: InterruptNumber,
{
async fn delay_ms(&mut self, ms: u32) {
self.delay(MillisDurationU32::from_ticks(ms).convert())
.await;
}

async fn delay_us(&mut self, us: u32) {
self.delay(MicrosDurationU32::from_ticks(us).convert())
.await;
}
impl<T, I> embedded_hal_async::delay::DelayNs for TimerFuture<T, I>
where
T: AsyncCount16,
I: InterruptNumber,
{
async fn delay_ns(&mut self, ns: u32) {
self.delay(NanosDurationU32::from_ticks(ns).convert()).await;
}
}

Expand Down

0 comments on commit b6d7f32

Please sign in to comment.