diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-11-29 17:12:30 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-29 17:12:30 +0100 |
| commit | 384bad7bfaa1f2415baf2cd3b69ebf36dc0a02d7 (patch) | |
| tree | 1992bf003d6afcdeae926db2308f369bccfc42ea /embassy-lora/src/lib.rs | |
| parent | b4bc9ac028568dfb3896dfb00cbd1e181863fd64 (diff) | |
| parent | 4634316749c41dd5d8cc2f316033c9098369ed2f (diff) | |
Merge pull request #2231 from embassy-rs/stable3
Update embedded-(hal,io,nal).
Diffstat (limited to 'embassy-lora/src/lib.rs')
| -rw-r--r-- | embassy-lora/src/lib.rs | 40 |
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 | |||
| 6 | pub(crate) mod fmt; | ||
| 7 | |||
| 8 | /// interface variants required by the external lora physical layer crate (lora-phy) | ||
| 9 | pub mod iv; | ||
| 10 | |||
| 11 | #[cfg(feature = "time")] | ||
| 12 | use embassy_time::{Duration, Instant, Timer}; | ||
| 13 | |||
| 14 | /// A convenience timer to use with the LoRaWAN crate | ||
| 15 | #[cfg(feature = "time")] | ||
| 16 | pub struct LoraTimer { | ||
| 17 | start: Instant, | ||
| 18 | } | ||
| 19 | |||
| 20 | #[cfg(feature = "time")] | ||
| 21 | impl LoraTimer { | ||
| 22 | pub fn new() -> Self { | ||
| 23 | Self { start: Instant::now() } | ||
| 24 | } | ||
| 25 | } | ||
| 26 | |||
| 27 | #[cfg(feature = "time")] | ||
| 28 | impl 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 | } | ||
