mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-25 21:19:35 +01:00
Cleanup weird locals in codegen
This commit is contained in:
parent
4337e3980c
commit
b9b3ded5e2
1 changed files with 11 additions and 28 deletions
|
@ -27,10 +27,6 @@ mod main;
|
||||||
|
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
pub fn app(app: &App, analysis: &Analysis) -> TokenStream2 {
|
pub fn app(app: &App, analysis: &Analysis) -> TokenStream2 {
|
||||||
let mut mod_app = vec![];
|
|
||||||
let mut root = vec![];
|
|
||||||
let mut user = vec![];
|
|
||||||
|
|
||||||
// Generate the `main` function
|
// Generate the `main` function
|
||||||
let main = main::codegen(app, analysis);
|
let main = main::codegen(app, analysis);
|
||||||
|
|
||||||
|
@ -38,24 +34,6 @@ pub fn app(app: &App, analysis: &Analysis) -> TokenStream2 {
|
||||||
|
|
||||||
let (mod_app_idle, root_idle, user_idle) = idle::codegen(app, analysis);
|
let (mod_app_idle, root_idle, user_idle) = idle::codegen(app, analysis);
|
||||||
|
|
||||||
user.push(quote!(
|
|
||||||
#user_init
|
|
||||||
|
|
||||||
#user_idle
|
|
||||||
));
|
|
||||||
|
|
||||||
root.push(quote!(
|
|
||||||
#(#root_init)*
|
|
||||||
|
|
||||||
#(#root_idle)*
|
|
||||||
));
|
|
||||||
|
|
||||||
mod_app.push(quote!(
|
|
||||||
#mod_app_init
|
|
||||||
|
|
||||||
#(#mod_app_idle)*
|
|
||||||
));
|
|
||||||
|
|
||||||
let (mod_app_shared_resources, mod_shared_resources) = shared_resources::codegen(app, analysis);
|
let (mod_app_shared_resources, mod_shared_resources) = shared_resources::codegen(app, analysis);
|
||||||
let (mod_app_local_resources, mod_local_resources) = local_resources::codegen(app, analysis);
|
let (mod_app_local_resources, mod_local_resources) = local_resources::codegen(app, analysis);
|
||||||
|
|
||||||
|
@ -85,13 +63,21 @@ pub fn app(app: &App, analysis: &Analysis) -> TokenStream2 {
|
||||||
#(#user_code)*
|
#(#user_code)*
|
||||||
/// User code end
|
/// User code end
|
||||||
|
|
||||||
#(#user)*
|
|
||||||
|
|
||||||
#(#user_hardware_tasks)*
|
#(#user_hardware_tasks)*
|
||||||
|
|
||||||
#(#user_software_tasks)*
|
#(#user_software_tasks)*
|
||||||
|
|
||||||
#(#root)*
|
#mod_app_init
|
||||||
|
|
||||||
|
#(#root_init)*
|
||||||
|
|
||||||
|
#user_init
|
||||||
|
|
||||||
|
#(#mod_app_idle)*
|
||||||
|
|
||||||
|
#(#root_idle)*
|
||||||
|
|
||||||
|
#user_idle
|
||||||
|
|
||||||
#mod_shared_resources
|
#mod_shared_resources
|
||||||
|
|
||||||
|
@ -101,9 +87,6 @@ pub fn app(app: &App, analysis: &Analysis) -> TokenStream2 {
|
||||||
|
|
||||||
#(#root_software_tasks)*
|
#(#root_software_tasks)*
|
||||||
|
|
||||||
/// app module
|
|
||||||
#(#mod_app)*
|
|
||||||
|
|
||||||
#(#mod_app_shared_resources)*
|
#(#mod_app_shared_resources)*
|
||||||
|
|
||||||
#(#mod_app_local_resources)*
|
#(#mod_app_local_resources)*
|
||||||
|
|
Loading…
Reference in a new issue