mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
allow handlers to be named 'main'
`#[init]`, `#[idle]` and `#[task]` handlers can now be named `main` fixes #311
This commit is contained in:
parent
1e827e24d0
commit
0ad311074e
7 changed files with 82 additions and 3 deletions
|
|
@ -141,7 +141,7 @@ pub fn codegen(app: &App, analysis: &Analysis, extra: &Extra) -> Vec<TokenStream
|
|||
#let_instant
|
||||
#fq.split().0.enqueue_unchecked(index);
|
||||
let priority = &rtfm::export::Priority::new(PRIORITY);
|
||||
#name(
|
||||
crate::#name(
|
||||
#locals_new
|
||||
#name::Context::new(priority #instant)
|
||||
#(,#pats)*
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ pub fn codegen(
|
|||
));
|
||||
|
||||
let locals_new = locals_new.iter();
|
||||
let call_idle = quote!(#name(
|
||||
let call_idle = quote!(crate::#name(
|
||||
#(#locals_new,)*
|
||||
#name::Context::new(&rtfm::export::Priority::new(0))
|
||||
));
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ pub fn codegen(
|
|||
|
||||
let locals_new = locals_new.iter();
|
||||
let call_init =
|
||||
Some(quote!(let late = #name(#(#locals_new,)* #name::Context::new(core.into()));));
|
||||
Some(quote!(let late = crate::#name(#(#locals_new,)* #name::Context::new(core.into()));));
|
||||
|
||||
root_init.push(module::codegen(Context::Init(core), needs_lt, app, extra));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue