aboutsummaryrefslogtreecommitdiff
path: root/embassy-time/src/lib.rs
diff options
context:
space:
mode:
authorFrostie314159 <[email protected]>2024-03-31 20:48:05 +0200
committerGitHub <[email protected]>2024-03-31 20:48:05 +0200
commit67c9cc2c4b886e6962ecdd6eff8794b14c1accdc (patch)
treef176ab269949d26f48e04c950cebc5489bae8c56 /embassy-time/src/lib.rs
parenta2f9aa592ec61beb247065003016515f0d423c13 (diff)
parent6634cc90bcd3eb25b64712688920f383584b2964 (diff)
Merge branch 'embassy-rs:main' into ticker_send_sync
Diffstat (limited to 'embassy-time/src/lib.rs')
-rw-r--r--embassy-time/src/lib.rs19
1 files changed, 5 insertions, 14 deletions
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs
index 82a7ee0df..3c8575ee9 100644
--- a/embassy-time/src/lib.rs
+++ b/embassy-time/src/lib.rs
@@ -1,20 +1,18 @@
1#![cfg_attr(not(any(feature = "std", feature = "wasm", test)), no_std)] 1#![cfg_attr(not(any(feature = "std", feature = "wasm", test)), no_std)]
2#![cfg_attr(nightly, feature(async_fn_in_trait, impl_trait_projections))]
3#![cfg_attr(nightly, allow(stable_features, unknown_lints))]
4#![allow(async_fn_in_trait)] 2#![allow(async_fn_in_trait)]
5#![doc = include_str!("../README.md")] 3#![doc = include_str!("../README.md")]
6#![allow(clippy::new_without_default)] 4#![allow(clippy::new_without_default)]
7#![warn(missing_docs)] 5#![warn(missing_docs)]
8 6
7//! ## Feature flags
8#![doc = document_features::document_features!(feature_label = r#"<span class="stab portability"><code>{feature}</code></span>"#)]
9
9// 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.
10pub(crate) mod fmt; 11pub(crate) mod fmt;
11 12
12mod delay; 13mod delay;
13pub mod driver;
14mod duration; 14mod duration;
15mod instant; 15mod instant;
16pub mod queue;
17mod tick;
18mod timer; 16mod timer;
19 17
20#[cfg(feature = "mock-driver")] 18#[cfg(feature = "mock-driver")]
@@ -32,16 +30,9 @@ mod queue_generic;
32 30
33pub use delay::{block_for, Delay}; 31pub use delay::{block_for, Delay};
34pub use duration::Duration; 32pub use duration::Duration;
33pub use embassy_time_driver::TICK_HZ;
35pub use instant::Instant; 34pub use instant::Instant;
36pub use timer::{with_timeout, Ticker, TimeoutError, Timer}; 35pub use timer::{with_deadline, with_timeout, Ticker, TimeoutError, Timer};
37
38/// Ticks per second of the global timebase.
39///
40/// This value is specified by the `tick-*` Cargo features, which
41/// should be set by the time driver. Some drivers support a fixed tick rate, others
42/// allow you to choose a tick rate with Cargo features of their own. You should not
43/// set the `tick-*` features for embassy yourself as an end user.
44pub const TICK_HZ: u64 = tick::TICK_HZ;
45 36
46const fn gcd(a: u64, b: u64) -> u64 { 37const fn gcd(a: u64, b: u64) -> u64 {
47 if b == 0 { 38 if b == 0 {