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.rs40
1 files changed, 0 insertions, 40 deletions
diff --git a/embassy-lora/src/lib.rs b/embassy-lora/src/lib.rs
deleted file mode 100644
index 653c98253..000000000
--- a/embassy-lora/src/lib.rs
+++ /dev/null
@@ -1,40 +0,0 @@
1#![no_std]
2#![feature(async_fn_in_trait, impl_trait_projections)]
3#![allow(stable_features, unknown_lints, async_fn_in_trait)]
4//! embassy-lora holds LoRa-specific functionality.
5
6pub(crate) mod fmt;
7
8/// interface variants required by the external lora physical layer crate (lora-phy)
9pub mod iv;
10
11#[cfg(feature = "time")]
12use embassy_time::{Duration, Instant, Timer};
13
14/// A convenience timer to use with the LoRaWAN crate
15#[cfg(feature = "time")]
16pub struct LoraTimer {
17 start: Instant,
18}
19
20#[cfg(feature = "time")]
21impl LoraTimer {
22 pub fn new() -> Self {
23 Self { start: Instant::now() }
24 }
25}
26
27#[cfg(feature = "time")]
28impl lorawan_device::async_device::radio::Timer for LoraTimer {
29 fn reset(&mut self) {
30 self.start = Instant::now();
31 }
32
33 async fn at(&mut self, millis: u64) {
34 Timer::at(self.start + Duration::from_millis(millis)).await
35 }
36
37 async fn delay_ms(&mut self, millis: u64) {
38 Timer::after_millis(millis).await
39 }
40}