diff options
| author | Raul Alimbekov <[email protected]> | 2025-12-16 09:05:22 +0300 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-16 09:05:22 +0300 |
| commit | c9a04b4b732b7a3b696eb8223664c1a7942b1875 (patch) | |
| tree | 6dbe5c02e66eed8d8762f13f95afd24f8db2b38c /embassy-time/src/lib.rs | |
| parent | cde24a3ef1117653ba5ed4184102b33f745782fb (diff) | |
| parent | 5ae6e060ec1c90561719aabdc29d5b6e7b8b0a82 (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'embassy-time/src/lib.rs')
| -rw-r--r-- | embassy-time/src/lib.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/embassy-time/src/lib.rs b/embassy-time/src/lib.rs index 77f4b344d..e375fe93e 100644 --- a/embassy-time/src/lib.rs +++ b/embassy-time/src/lib.rs | |||
| @@ -1,5 +1,6 @@ | |||
| 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 | #![allow(async_fn_in_trait)] | 2 | #![allow(async_fn_in_trait)] |
| 3 | #![allow(unsafe_op_in_unsafe_fn)] | ||
| 3 | #![doc = include_str!("../README.md")] | 4 | #![doc = include_str!("../README.md")] |
| 4 | #![allow(clippy::new_without_default)] | 5 | #![allow(clippy::new_without_default)] |
| 5 | #![warn(missing_docs)] | 6 | #![warn(missing_docs)] |
| @@ -27,18 +28,14 @@ mod driver_std; | |||
| 27 | #[cfg(feature = "wasm")] | 28 | #[cfg(feature = "wasm")] |
| 28 | mod driver_wasm; | 29 | mod driver_wasm; |
| 29 | 30 | ||
| 30 | pub use delay::{block_for, Delay}; | 31 | pub use delay::{Delay, block_for}; |
| 31 | pub use duration::Duration; | 32 | pub use duration::Duration; |
| 32 | pub use embassy_time_driver::TICK_HZ; | 33 | pub use embassy_time_driver::TICK_HZ; |
| 33 | pub use instant::Instant; | 34 | pub use instant::Instant; |
| 34 | pub use timer::{with_deadline, with_timeout, Ticker, TimeoutError, Timer, WithTimeout}; | 35 | pub use timer::{Ticker, TimeoutError, Timer, WithTimeout, with_deadline, with_timeout}; |
| 35 | 36 | ||
| 36 | const fn gcd(a: u64, b: u64) -> u64 { | 37 | const fn gcd(a: u64, b: u64) -> u64 { |
| 37 | if b == 0 { | 38 | if b == 0 { a } else { gcd(b, a % b) } |
| 38 | a | ||
| 39 | } else { | ||
| 40 | gcd(b, a % b) | ||
| 41 | } | ||
| 42 | } | 39 | } |
| 43 | 40 | ||
| 44 | pub(crate) const GCD_1K: u64 = gcd(TICK_HZ, 1_000); | 41 | pub(crate) const GCD_1K: u64 = gcd(TICK_HZ, 1_000); |
