diff options
author | 2021-04-20 10:34:26 +0200 | |
---|---|---|
committer | 2021-04-20 10:34:26 +0200 | |
commit | fbcf2aabb0e5fdb1aa4f620b92c49ba57a5dce6a (patch) | |
tree | a6ff1ca9ecfa6d9751f116807125fbb060e285ce /macros/src | |
parent | b8b13573aebfa6719e25f0e2c8b1c28cdb66301a (diff) | |
download | rtic-fbcf2aabb0e5fdb1aa4f620b92c49ba57a5dce6a.tar.gz rtic-fbcf2aabb0e5fdb1aa4f620b92c49ba57a5dce6a.tar.zst rtic-fbcf2aabb0e5fdb1aa4f620b92c49ba57a5dce6a.zip |
Fix for default monotonic, `monotonics::now()` now properly works
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/codegen.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index cf728a7d..a81d5332 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -111,7 +111,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 { |