aboutsummaryrefslogtreecommitdiff
path: root/macros/src/codegen/post_init.rs
diff options
context:
space:
mode:
authorGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-03 21:04:06 +0100
committerGravatar Emil Fresk <emil.fresk@gmail.com> 2020-12-03 21:04:06 +0100
commitef50aeb2e8245b69843280fabb62589c0716ffdd (patch)
treea159de70654135eb87c52629c6026766eac3bff0 /macros/src/codegen/post_init.rs
parent3b4c10e790e63ac328a7bdb98451ac11d5935731 (diff)
downloadrtic-ef50aeb2e8245b69843280fabb62589c0716ffdd.tar.gz
rtic-ef50aeb2e8245b69843280fabb62589c0716ffdd.tar.zst
rtic-ef50aeb2e8245b69843280fabb62589c0716ffdd.zip
Save, init generation fixed
Diffstat (limited to 'macros/src/codegen/post_init.rs')
-rw-r--r--macros/src/codegen/post_init.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/macros/src/codegen/post_init.rs b/macros/src/codegen/post_init.rs
index 5545944d..9174daeb 100644
--- a/macros/src/codegen/post_init.rs
+++ b/macros/src/codegen/post_init.rs
@@ -25,6 +25,9 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> {
}
}
+ // Forget the monotonics so they won't be dropped.
+ stmts.push(quote!(core::mem::forget(monotonics);));
+
// Enable the interrupts -- this completes the `init`-ialization phase
stmts.push(quote!(rtic::export::interrupt::enable();));