diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/src/codegen.rs | 2 | ||||
-rw-r--r-- | macros/src/codegen/module.rs | 4 | ||||
-rw-r--r-- | macros/src/codegen/pre_init.rs | 4 | ||||
-rw-r--r-- | macros/src/codegen/spawn_body.rs | 5 | ||||
-rw-r--r-- | macros/src/codegen/timer_queue.rs | 3 | ||||
-rw-r--r-- | macros/src/codegen/util.rs | 2 |
6 files changed, 9 insertions, 11 deletions
diff --git a/macros/src/codegen.rs b/macros/src/codegen.rs index a44266ad..a256ac75 100644 --- a/macros/src/codegen.rs +++ b/macros/src/codegen.rs @@ -161,7 +161,7 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 { /// Implementation details mod #name { /// Always include the device crate which contains the vector table - use #device as _; + use #device as you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml; #(#imports)* #(#user_imports)* diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 2e51e7db..3d90cbd3 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -15,7 +15,7 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) -> let mut lt = None; match ctxt { Context::Init => { - if app.uses_schedule() { + if extra.monotonic.is_some() { let m = extra.monotonic(); fields.push(quote!( @@ -277,7 +277,7 @@ pub fn codegen(ctxt: Context, resources_tick: bool, app: &App, extra: &Extra) -> }; let core = if ctxt.is_init() { - if app.uses_schedule() { + if extra.monotonic.is_some() { Some(quote!(core: rtic::Peripherals,)) } else { Some(quote!(core: rtic::export::Peripherals,)) diff --git a/macros/src/codegen/pre_init.rs b/macros/src/codegen/pre_init.rs index 9c5f35ec..2aaf9ebd 100644 --- a/macros/src/codegen/pre_init.rs +++ b/macros/src/codegen/pre_init.rs @@ -53,14 +53,14 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream let interrupt = util::interrupt_ident(); stmts.push(quote!( core.NVIC.set_priority( - #device::#interrupt::#name, + you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#interrupt::#name, rtic::export::logical2hw(#priority, #nvic_prio_bits), ); )); // NOTE unmask the interrupt *after* setting its priority: changing the priority of a pended // interrupt is implementation defined - stmts.push(quote!(rtic::export::NVIC::unmask(#device::#interrupt::#name);)); + stmts.push(quote!(rtic::export::NVIC::unmask(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#interrupt::#name);)); } // Set exception priorities diff --git a/macros/src/codegen/spawn_body.rs b/macros/src/codegen/spawn_body.rs index 4ecd0757..f29393a6 100644 --- a/macros/src/codegen/spawn_body.rs +++ b/macros/src/codegen/spawn_body.rs @@ -10,7 +10,7 @@ pub fn codegen( name: &Ident, app: &App, analysis: &Analysis, - extra: &Extra, + _extra: &Extra, ) -> TokenStream2 { let spawnee = &app.software_tasks[name]; let priority = spawnee.args.priority; @@ -42,12 +42,11 @@ pub fn codegen( ) }; - let device = extra.device; let enum_ = util::interrupt_ident(); let interrupt = &analysis.interrupts.get(&priority); let pend = { quote!( - rtic::pend(#device::#enum_::#interrupt); + rtic::pend(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#enum_::#interrupt); ) }; diff --git a/macros/src/codegen/timer_queue.rs b/macros/src/codegen/timer_queue.rs index 030158e2..0abbf49d 100644 --- a/macros/src/codegen/timer_queue.rs +++ b/macros/src/codegen/timer_queue.rs @@ -72,7 +72,6 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream // Timer queue handler { - let device = extra.device; let arms = timer_queue .tasks .iter() @@ -88,7 +87,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream let pend = { quote!( - rtic::pend(#device::#enum_::#interrupt); + rtic::pend(you_must_enable_the_rt_feature_for_the_pac_in_your_cargo_toml::#enum_::#interrupt); ) }; diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 2f9f3cce..41ee3ca7 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -83,7 +83,7 @@ pub fn instants_ident(task: &Ident) -> Ident { pub fn interrupt_ident() -> Ident { let span = Span::call_site(); - Ident::new("Interrupt", span) + Ident::new("interrupt", span) } /// Whether `name` is an exception with configurable priority |