mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-27 14:04:56 +01:00
Fix for default monotonic, monotonics::now()
now properly works
This commit is contained in:
parent
b8b13573ae
commit
fbcf2aabb0
2 changed files with 9 additions and 1 deletions
|
@ -40,7 +40,7 @@ mod app {
|
||||||
let _: Result<(), ()> = handle.unwrap().cancel();
|
let _: Result<(), ()> = handle.unwrap().cancel();
|
||||||
|
|
||||||
// Using default
|
// Using default
|
||||||
let _: Result<foo::SpawnHandle, ()> = foo::spawn_at(monotonics::MyMono::now());
|
let _: Result<foo::SpawnHandle, ()> = foo::spawn_at(monotonics::now());
|
||||||
let handle: Result<foo::SpawnHandle, ()> = foo::spawn_after(Seconds(1_u32));
|
let handle: Result<foo::SpawnHandle, ()> = foo::spawn_after(Seconds(1_u32));
|
||||||
let _: Result<foo::SpawnHandle, ()> = handle.unwrap().reschedule_after(Seconds(1_u32));
|
let _: Result<foo::SpawnHandle, ()> = handle.unwrap().reschedule_after(Seconds(1_u32));
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,15 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
);
|
);
|
||||||
let user_imports = &app.user_imports;
|
let user_imports = &app.user_imports;
|
||||||
|
|
||||||
|
let default_monotonic = if monotonic.args.default {
|
||||||
|
quote!(pub use #name::now;)
|
||||||
|
} else {
|
||||||
|
quote!()
|
||||||
|
};
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
|
#default_monotonic
|
||||||
|
|
||||||
#[doc = #doc]
|
#[doc = #doc]
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
pub mod #name {
|
pub mod #name {
|
||||||
|
|
Loading…
Reference in a new issue