diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-01-11 16:38:44 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-01-11 16:56:08 +0100 |
| commit | 15f94fb0fc70463b9a50c997083fee3f5758b17a (patch) | |
| tree | 17ccb5d369a9e7b0d2dbe0c7e39804b7f1f65458 /embassy-time/src/lib.rs | |
| parent | dcffad6b05a06bc5f4d09a35184d5ffe158e02cf (diff) | |
time: split driver into a separate embassy-time-driver crate.
Diffstat (limited to 'embassy-time/src/lib.rs')
| -rw-r--r-- | embassy-time/src/lib.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs index 7e2546f68..3f8c09f1a 100644 --- a/embassy-time/src/lib.rs +++ b/embassy-time/src/lib.rs | |||
| @@ -10,12 +10,12 @@ | |||
| 10 | // This mod MUST go first, so that the others see its macros. | 10 | // This mod MUST go first, so that the others see its macros. |
| 11 | pub(crate) mod fmt; | 11 | pub(crate) mod fmt; |
| 12 | 12 | ||
| 13 | pub use embassy_time_driver as driver; | ||
| 14 | |||
| 13 | mod delay; | 15 | mod delay; |
| 14 | pub mod driver; | ||
| 15 | mod duration; | 16 | mod duration; |
| 16 | mod instant; | 17 | mod instant; |
| 17 | pub mod queue; | 18 | pub mod queue; |
| 18 | mod tick; | ||
| 19 | mod timer; | 19 | mod timer; |
| 20 | 20 | ||
| 21 | #[cfg(feature = "mock-driver")] | 21 | #[cfg(feature = "mock-driver")] |
| @@ -32,15 +32,11 @@ mod driver_wasm; | |||
| 32 | mod queue_generic; | 32 | mod queue_generic; |
| 33 | 33 | ||
| 34 | pub use delay::{block_for, Delay}; | 34 | pub use delay::{block_for, Delay}; |
| 35 | pub use driver::TICK_HZ; | ||
| 35 | pub use duration::Duration; | 36 | pub use duration::Duration; |
| 36 | pub use instant::Instant; | 37 | pub use instant::Instant; |
| 37 | pub use timer::{with_timeout, Ticker, TimeoutError, Timer}; | 38 | pub use timer::{with_timeout, Ticker, TimeoutError, Timer}; |
| 38 | 39 | ||
| 39 | /// Ticks per second of the global timebase. | ||
| 40 | /// | ||
| 41 | /// This value is specified by the [`tick-*` Cargo features](crate#tick-rate) | ||
| 42 | pub const TICK_HZ: u64 = tick::TICK_HZ; | ||
| 43 | |||
| 44 | const fn gcd(a: u64, b: u64) -> u64 { | 40 | const fn gcd(a: u64, b: u64) -> u64 { |
| 45 | if b == 0 { | 41 | if b == 0 { |
| 46 | a | 42 | a |
