mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
Add delay_until
a specific time
This commit is contained in:
parent
ecf5e6e334
commit
4ccc7d3dcb
1 changed files with 11 additions and 0 deletions
|
@ -46,6 +46,8 @@ pub fn codegen(app: &App, _analysis: &Analysis, _extra: &Extra) -> TokenStream2
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use #m::delay;
|
pub use #m::delay;
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
|
pub use #m::delay_until;
|
||||||
|
#[doc(inline)]
|
||||||
pub use #m::timeout_at;
|
pub use #m::timeout_at;
|
||||||
#[doc(inline)]
|
#[doc(inline)]
|
||||||
pub use #m::timeout_after;
|
pub use #m::timeout_after;
|
||||||
|
@ -81,6 +83,15 @@ pub fn codegen(app: &App, _analysis: &Analysis, _extra: &Extra) -> TokenStream2
|
||||||
DelayFuture { until, waker_storage: None }
|
DelayFuture { until, waker_storage: None }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Delay until a specific time
|
||||||
|
#[inline(always)]
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
pub fn delay_until(instant: <super::super::#m as rtic::Monotonic>::Instant)
|
||||||
|
-> DelayFuture {
|
||||||
|
let until = instant;
|
||||||
|
DelayFuture { until, waker_storage: None }
|
||||||
|
}
|
||||||
|
|
||||||
/// Delay future.
|
/// Delay future.
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
|
|
Loading…
Reference in a new issue