mirror of
https://github.com/rtic-rs/rtic.git
synced 2024-11-29 15:04:32 +01:00
cfg_core is gone, cargo fmt
This commit is contained in:
parent
6d234f9c95
commit
a151974245
6 changed files with 36 additions and 19 deletions
|
@ -37,11 +37,13 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
|
|
||||||
let pre_init_stmts = pre_init::codegen(&app, analysis, extra);
|
let pre_init_stmts = pre_init::codegen(&app, analysis, extra);
|
||||||
|
|
||||||
let (const_app_init, root_init, user_init, user_init_imports, call_init) = init::codegen(app, analysis, extra);
|
let (const_app_init, root_init, user_init, user_init_imports, call_init) =
|
||||||
|
init::codegen(app, analysis, extra);
|
||||||
|
|
||||||
let post_init_stmts = post_init::codegen(&app, analysis);
|
let post_init_stmts = post_init::codegen(&app, analysis);
|
||||||
|
|
||||||
let (const_app_idle, root_idle, user_idle, user_idle_imports, call_idle) = idle::codegen(app, analysis, extra);
|
let (const_app_idle, root_idle, user_idle, user_idle_imports, call_idle) =
|
||||||
|
idle::codegen(app, analysis, extra);
|
||||||
|
|
||||||
if user_init.is_some() {
|
if user_init.is_some() {
|
||||||
const_app_imports.push(quote!(
|
const_app_imports.push(quote!(
|
||||||
|
@ -95,13 +97,22 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
||||||
let (const_app_resources, mod_resources, mod_resources_imports) = resources::codegen(app, analysis, extra);
|
let (const_app_resources, mod_resources, mod_resources_imports) =
|
||||||
|
resources::codegen(app, analysis, extra);
|
||||||
|
|
||||||
let (const_app_hardware_tasks, root_hardware_tasks, user_hardware_tasks, user_hardware_tasks_imports) =
|
let (
|
||||||
hardware_tasks::codegen(app, analysis, extra);
|
const_app_hardware_tasks,
|
||||||
|
root_hardware_tasks,
|
||||||
|
user_hardware_tasks,
|
||||||
|
user_hardware_tasks_imports,
|
||||||
|
) = hardware_tasks::codegen(app, analysis, extra);
|
||||||
|
|
||||||
let (const_app_software_tasks, root_software_tasks, user_software_tasks, user_software_tasks_imports) =
|
let (
|
||||||
software_tasks::codegen(app, analysis, extra);
|
const_app_software_tasks,
|
||||||
|
root_software_tasks,
|
||||||
|
user_software_tasks,
|
||||||
|
user_software_tasks_imports,
|
||||||
|
) = software_tasks::codegen(app, analysis, extra);
|
||||||
|
|
||||||
let const_app_dispatchers = dispatchers::codegen(app, analysis, extra);
|
let const_app_dispatchers = dispatchers::codegen(app, analysis, extra);
|
||||||
|
|
||||||
|
@ -111,7 +122,6 @@ pub fn app(app: &App, analysis: &Analysis, extra: &Extra) -> TokenStream2 {
|
||||||
|
|
||||||
let const_app_schedule = schedule::codegen(app, extra);
|
let const_app_schedule = schedule::codegen(app, extra);
|
||||||
|
|
||||||
|
|
||||||
let user_imports = app.user_imports.clone();
|
let user_imports = app.user_imports.clone();
|
||||||
let name = &app.name;
|
let name = &app.name;
|
||||||
let device = extra.device;
|
let device = extra.device;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use proc_macro2::TokenStream as TokenStream2;
|
use proc_macro2::TokenStream as TokenStream2;
|
||||||
use quote::{quote, format_ident};
|
use quote::{format_ident, quote};
|
||||||
use rtic_syntax::{ast::App, Context};
|
use rtic_syntax::{ast::App, Context};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -128,7 +128,6 @@ pub fn codegen(
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
use super::#name;
|
use super::#name;
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(const_app, root, user_tasks, hardware_tasks_imports)
|
(const_app, root, user_tasks, hardware_tasks_imports)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use proc_macro2::TokenStream as TokenStream2;
|
use proc_macro2::TokenStream as TokenStream2;
|
||||||
use quote::{quote, format_ident};
|
use quote::{format_ident, quote};
|
||||||
use rtic_syntax::{ast::App, Context};
|
use rtic_syntax::{ast::App, Context};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -52,7 +52,6 @@ pub fn codegen(
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
use super::#name_resource;
|
use super::#name_resource;
|
||||||
));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !idle.locals.is_empty() {
|
if !idle.locals.is_empty() {
|
||||||
|
@ -81,7 +80,6 @@ pub fn codegen(
|
||||||
user_idle_imports.push(quote!(
|
user_idle_imports.push(quote!(
|
||||||
#(#attrs)*
|
#(#attrs)*
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
#cfg_core
|
|
||||||
use super::#name;
|
use super::#name;
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -91,7 +89,13 @@ pub fn codegen(
|
||||||
#name::Context::new(&rtic::export::Priority::new(0))
|
#name::Context::new(&rtic::export::Priority::new(0))
|
||||||
));
|
));
|
||||||
|
|
||||||
(const_app, root_idle, user_idle, user_idle_imports, call_idle)
|
(
|
||||||
|
const_app,
|
||||||
|
root_idle,
|
||||||
|
user_idle,
|
||||||
|
user_idle_imports,
|
||||||
|
call_idle,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use proc_macro2::TokenStream as TokenStream2;
|
use proc_macro2::TokenStream as TokenStream2;
|
||||||
use quote::{quote, format_ident};
|
use quote::{format_ident, quote};
|
||||||
use rtic_syntax::{ast::App, Context};
|
use rtic_syntax::{ast::App, Context};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -101,7 +101,6 @@ pub fn codegen(
|
||||||
));
|
));
|
||||||
user_init_imports.push(quote!(
|
user_init_imports.push(quote!(
|
||||||
#(#attrs)*
|
#(#attrs)*
|
||||||
#cfg_core
|
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
use super::#name;
|
use super::#name;
|
||||||
));
|
));
|
||||||
|
@ -128,7 +127,13 @@ pub fn codegen(
|
||||||
|
|
||||||
root_init.push(module::codegen(Context::Init, needs_lt, app, extra));
|
root_init.push(module::codegen(Context::Init, needs_lt, app, extra));
|
||||||
|
|
||||||
(const_app, root_init, user_init, user_init_imports, call_init)
|
(
|
||||||
|
const_app,
|
||||||
|
root_init,
|
||||||
|
user_init,
|
||||||
|
user_init_imports,
|
||||||
|
call_init,
|
||||||
|
)
|
||||||
} else {
|
} else {
|
||||||
(None, vec![], None, vec![], None)
|
(None, vec![], None, vec![], None)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,6 @@ pub fn codegen(
|
||||||
mod_resources_imports.push(quote!(
|
mod_resources_imports.push(quote!(
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#(#cfgs)*
|
#(#cfgs)*
|
||||||
#cfg_core
|
|
||||||
use super::resources::#name;
|
use super::resources::#name;
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use proc_macro2::TokenStream as TokenStream2;
|
use proc_macro2::TokenStream as TokenStream2;
|
||||||
use quote::{quote, format_ident};
|
use quote::{format_ident, quote};
|
||||||
use rtic_syntax::{ast::App, Context};
|
use rtic_syntax::{ast::App, Context};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
Loading…
Reference in a new issue