aboutsummaryrefslogtreecommitdiff
path: root/rtic-macros/src/codegen/pre_init.rs
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-macros/src/codegen/pre_init.rs')
-rw-r--r--rtic-macros/src/codegen/pre_init.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/rtic-macros/src/codegen/pre_init.rs b/rtic-macros/src/codegen/pre_init.rs
index a2d0e8c..8de75ff 100644
--- a/rtic-macros/src/codegen/pre_init.rs
+++ b/rtic-macros/src/codegen/pre_init.rs
@@ -11,10 +11,12 @@ pub fn codegen(app: &App, analysis: &Analysis) -> Vec<TokenStream2> {
// Disable interrupts -- `init` must run with interrupts disabled
stmts.push(quote!(rtic::export::interrupt::disable();));
- stmts.push(quote!(
- // To set the variable in cortex_m so the peripherals cannot be taken multiple times
- let mut core: rtic::export::Peripherals = rtic::export::Peripherals::steal().into();
- ));
+ if app.args.core {
+ stmts.push(quote!(
+ // To set the variable in cortex_m so the peripherals cannot be taken multiple times
+ let mut core: rtic::export::Peripherals = rtic::export::Peripherals::steal().into();
+ ));
+ }
stmts.append(&mut pre_init_checks(app, analysis));