aboutsummaryrefslogtreecommitdiff
path: root/embassy-lora/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-lora/src/lib.rs')
-rw-r--r--embassy-lora/src/lib.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/embassy-lora/src/lib.rs b/embassy-lora/src/lib.rs
index 3e4748430..5c919cbb6 100644
--- a/embassy-lora/src/lib.rs
+++ b/embassy-lora/src/lib.rs
@@ -1,5 +1,6 @@
1#![no_std] 1#![no_std]
2#![feature(type_alias_impl_trait)] 2#![feature(async_fn_in_trait, impl_trait_projections)]
3#![allow(incomplete_features)]
3//! embassy-lora is a collection of async radio drivers that integrate with the lorawan-device 4//! embassy-lora is a collection of async radio drivers that integrate with the lorawan-device
4//! crate's async LoRaWAN MAC implementation. 5//! crate's async LoRaWAN MAC implementation.
5 6
@@ -34,13 +35,11 @@ impl lorawan_device::async_device::radio::Timer for LoraTimer {
34 self.start = Instant::now(); 35 self.start = Instant::now();
35 } 36 }
36 37
37 type AtFuture<'m> = impl core::future::Future<Output = ()> + 'm; 38 async fn at(&mut self, millis: u64) {
38 fn at<'m>(&'m mut self, millis: u64) -> Self::AtFuture<'m> { 39 Timer::at(self.start + Duration::from_millis(millis)).await
39 Timer::at(self.start + Duration::from_millis(millis))
40 } 40 }
41 41
42 type DelayFuture<'m> = impl core::future::Future<Output = ()> + 'm; 42 async fn delay_ms(&mut self, millis: u64) {
43 fn delay_ms<'m>(&'m mut self, millis: u64) -> Self::DelayFuture<'m> { 43 Timer::after(Duration::from_millis(millis)).await
44 Timer::after(Duration::from_millis(millis))
45 } 44 }
46} 45}