diff --git a/examples/t-schedule.rs b/examples/t-schedule.rs index 5e38dbaf90..d7051609f7 100644 --- a/examples/t-schedule.rs +++ b/examples/t-schedule.rs @@ -40,7 +40,7 @@ mod app { let _: Result<(), ()> = handle.unwrap().cancel(); // Using default - let _: Result = foo::spawn_at(monotonics::MyMono::now()); + let _: Result = foo::spawn_at(monotonics::now()); let handle: Result = foo::spawn_after(Seconds(1_u32)); let _: Result = handle.unwrap().reschedule_after(Seconds(1_u32)); diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index 21db14389c..e0e09bbe8a 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -119,7 +119,15 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { ); let user_imports = &app.user_imports; + let default_monotonic = if monotonic.args.default { + quote!(pub use #name::now;) + } else { + quote!() + }; + quote! { + #default_monotonic + #[doc = #doc] #[allow(non_snake_case)] pub mod #name {