mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-28 04:40:39 +00:00
modify async fn to return impl Future
This commit is contained in:
parent
bfe4395b3b
commit
011c382b77
@ -1,3 +1,5 @@
|
||||
use core::future::Future;
|
||||
|
||||
use super::{Duration, Instant};
|
||||
use crate::Timer;
|
||||
|
||||
@ -32,16 +34,16 @@ impl embedded_hal_1::delay::DelayNs for Delay {
|
||||
}
|
||||
|
||||
impl embedded_hal_async::delay::DelayNs for Delay {
|
||||
async fn delay_ns(&mut self, ns: u32) {
|
||||
Timer::after_nanos(ns as _).await
|
||||
fn delay_ns(&mut self, ns: u32) -> impl Future<Output = ()> {
|
||||
Timer::after_nanos(ns as _)
|
||||
}
|
||||
|
||||
async fn delay_us(&mut self, us: u32) {
|
||||
Timer::after_micros(us as _).await
|
||||
fn delay_us(&mut self, us: u32) -> impl Future<Output = ()> {
|
||||
Timer::after_micros(us as _)
|
||||
}
|
||||
|
||||
async fn delay_ms(&mut self, ms: u32) {
|
||||
Timer::after_millis(ms as _).await
|
||||
fn delay_ms(&mut self, ms: u32) -> impl Future<Output = ()> {
|
||||
Timer::after_millis(ms as _)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user