aboutsummaryrefslogtreecommitdiff
path: root/embassy-time/src/lib.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-01-11 16:38:44 +0100
committerDario Nieuwenhuis <[email protected]>2024-01-11 16:56:08 +0100
commit15f94fb0fc70463b9a50c997083fee3f5758b17a (patch)
tree17ccb5d369a9e7b0d2dbe0c7e39804b7f1f65458 /embassy-time/src/lib.rs
parentdcffad6b05a06bc5f4d09a35184d5ffe158e02cf (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.rs10
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.
11pub(crate) mod fmt; 11pub(crate) mod fmt;
12 12
13pub use embassy_time_driver as driver;
14
13mod delay; 15mod delay;
14pub mod driver;
15mod duration; 16mod duration;
16mod instant; 17mod instant;
17pub mod queue; 18pub mod queue;
18mod tick;
19mod timer; 19mod timer;
20 20
21#[cfg(feature = "mock-driver")] 21#[cfg(feature = "mock-driver")]
@@ -32,15 +32,11 @@ mod driver_wasm;
32mod queue_generic; 32mod queue_generic;
33 33
34pub use delay::{block_for, Delay}; 34pub use delay::{block_for, Delay};
35pub use driver::TICK_HZ;
35pub use duration::Duration; 36pub use duration::Duration;
36pub use instant::Instant; 37pub use instant::Instant;
37pub use timer::{with_timeout, Ticker, TimeoutError, Timer}; 38pub 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)
42pub const TICK_HZ: u64 = tick::TICK_HZ;
43
44const fn gcd(a: u64, b: u64) -> u64 { 40const fn gcd(a: u64, b: u64) -> u64 {
45 if b == 0 { 41 if b == 0 {
46 a 42 a