diff options
| author | Frostie314159 <[email protected]> | 2024-03-31 20:48:05 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-03-31 20:48:05 +0200 |
| commit | 67c9cc2c4b886e6962ecdd6eff8794b14c1accdc (patch) | |
| tree | f176ab269949d26f48e04c950cebc5489bae8c56 /embassy-time/src/lib.rs | |
| parent | a2f9aa592ec61beb247065003016515f0d423c13 (diff) | |
| parent | 6634cc90bcd3eb25b64712688920f383584b2964 (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.rs | 19 |
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. |
| 10 | pub(crate) mod fmt; | 11 | pub(crate) mod fmt; |
| 11 | 12 | ||
| 12 | mod delay; | 13 | mod delay; |
| 13 | pub mod driver; | ||
| 14 | mod duration; | 14 | mod duration; |
| 15 | mod instant; | 15 | mod instant; |
| 16 | pub mod queue; | ||
| 17 | mod tick; | ||
| 18 | mod timer; | 16 | mod timer; |
| 19 | 17 | ||
| 20 | #[cfg(feature = "mock-driver")] | 18 | #[cfg(feature = "mock-driver")] |
| @@ -32,16 +30,9 @@ mod queue_generic; | |||
| 32 | 30 | ||
| 33 | pub use delay::{block_for, Delay}; | 31 | pub use delay::{block_for, Delay}; |
| 34 | pub use duration::Duration; | 32 | pub use duration::Duration; |
| 33 | pub use embassy_time_driver::TICK_HZ; | ||
| 35 | pub use instant::Instant; | 34 | pub use instant::Instant; |
| 36 | pub use timer::{with_timeout, Ticker, TimeoutError, Timer}; | 35 | pub 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. | ||
| 44 | pub const TICK_HZ: u64 = tick::TICK_HZ; | ||
| 45 | 36 | ||
| 46 | const fn gcd(a: u64, b: u64) -> u64 { | 37 | const fn gcd(a: u64, b: u64) -> u64 { |
| 47 | if b == 0 { | 38 | if b == 0 { |
