diff options
author | 2023-01-22 03:03:24 +0100 | |
---|---|---|
committer | 2023-01-22 12:00:08 +0100 | |
commit | be74469ab71341da9a564ce1bc3e0e3f17009688 (patch) | |
tree | f4a8c431fb449c394ef80cb171002ba6e58913e8 /macros/src/codegen/software_tasks.rs | |
parent | 3240fb332a7b1b17333ac1c589b303909bde1dc9 (diff) | |
download | rtic-be74469ab71341da9a564ce1bc3e0e3f17009688.tar.gz rtic-be74469ab71341da9a564ce1bc3e0e3f17009688.tar.zst rtic-be74469ab71341da9a564ce1bc3e0e3f17009688.zip |
Enable at least masking out a Monotonic
Simplest case working, but leaves a lot to ask
as shown by examples/cfg-monotonic.rs
Current `rtic-syntax` is unable to validate and
handle the `cfgs[]` which limits the usefulness
of this.
Diffstat (limited to 'macros/src/codegen/software_tasks.rs')
-rw-r--r-- | macros/src/codegen/software_tasks.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index 7c3f70fb..6bd2a71f 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -62,6 +62,7 @@ pub fn codegen( for (_, monotonic) in &app.monotonics { let instants = util::monotonic_instants_ident(name, &monotonic.ident); let mono_type = &monotonic.ty; + let cfgs = &monotonic.cfgs; let uninit = mk_uninit(); // For future use @@ -73,6 +74,7 @@ pub fn codegen( #[allow(non_camel_case_types)] #[allow(non_upper_case_globals)] #[doc(hidden)] + #(#cfgs)* static #instants: rtic::RacyCell<[core::mem::MaybeUninit<<#mono_type as rtic::Monotonic>::Instant>; #cap_lit]> = rtic::RacyCell::new([#(#elems,)*]); |