aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-traits/src/delay.rs5
-rw-r--r--embassy/src/executor/timer.rs4
2 files changed, 4 insertions, 5 deletions
diff --git a/embassy-traits/src/delay.rs b/embassy-traits/src/delay.rs
index 1e763350b..31239d319 100644
--- a/embassy-traits/src/delay.rs
+++ b/embassy-traits/src/delay.rs
@@ -1,12 +1,11 @@
1use core::future::Future; 1use core::future::Future;
2use core::pin::Pin;
3 2
4pub trait Delay { 3pub trait Delay {
5 type DelayFuture<'a>: Future<Output = ()> + 'a; 4 type DelayFuture<'a>: Future<Output = ()> + 'a;
6 5
7 /// Future that completes after now + millis 6 /// Future that completes after now + millis
8 fn delay_ms<'a>(self: Pin<&'a mut Self>, millis: u64) -> Self::DelayFuture<'a>; 7 fn delay_ms<'a>(&'a mut self, millis: u64) -> Self::DelayFuture<'a>;
9 8
10 /// Future that completes after now + micros 9 /// Future that completes after now + micros
11 fn delay_us<'a>(self: Pin<&'a mut Self>, micros: u64) -> Self::DelayFuture<'a>; 10 fn delay_us<'a>(&'a mut self, micros: u64) -> Self::DelayFuture<'a>;
12} 11}
diff --git a/embassy/src/executor/timer.rs b/embassy/src/executor/timer.rs
index 8297564a0..d66c7cae5 100644
--- a/embassy/src/executor/timer.rs
+++ b/embassy/src/executor/timer.rs
@@ -23,10 +23,10 @@ impl Delay {
23impl crate::traits::delay::Delay for Delay { 23impl crate::traits::delay::Delay for Delay {
24 type DelayFuture<'a> = impl Future<Output = ()> + 'a; 24 type DelayFuture<'a> = impl Future<Output = ()> + 'a;
25 25
26 fn delay_ms<'a>(self: Pin<&'a mut Self>, millis: u64) -> Self::DelayFuture<'a> { 26 fn delay_ms<'a>(&'a mut self, millis: u64) -> Self::DelayFuture<'a> {
27 Timer::after(Duration::from_millis(millis)) 27 Timer::after(Duration::from_millis(millis))
28 } 28 }
29 fn delay_us<'a>(self: Pin<&'a mut Self>, micros: u64) -> Self::DelayFuture<'a> { 29 fn delay_us<'a>(&'a mut self, micros: u64) -> Self::DelayFuture<'a> {
30 Timer::after(Duration::from_micros(micros)) 30 Timer::after(Duration::from_micros(micros))
31 } 31 }
32} 32}