diff options
author | 2020-09-04 07:50:13 +0000 | |
---|---|---|
committer | 2020-09-04 07:50:13 +0000 | |
commit | 7506bd8ae0ba335fc058c2138438fab5f20f6dab (patch) | |
tree | fe65b335b19171370bd6be0bd5cd6b776a1d6110 /macros/src/codegen/hardware_tasks.rs | |
parent | c5e6d1fa49e3596227a8ee8fe89e2e4f66db3169 (diff) | |
parent | ad2b80907899cc335edcebfc77ae4b4b51272b87 (diff) | |
download | rtic-7506bd8ae0ba335fc058c2138438fab5f20f6dab.tar.gz rtic-7506bd8ae0ba335fc058c2138438fab5f20f6dab.tar.zst rtic-7506bd8ae0ba335fc058c2138438fab5f20f6dab.zip |
Merge #355
355: Multi-core removal r=korken89 a=AfoHT
Dependent on https://github.com/rtic-rs/rtic-syntax/pull/27
With the same reasoning as ^^
For now the testing is done against my rtic-syntax/multiremove-branch, but before we merge it should corrected.
Co-authored-by: Henrik Tjäder <henrik@tjaders.com>
Diffstat (limited to 'macros/src/codegen/hardware_tasks.rs')
-rw-r--r-- | macros/src/codegen/hardware_tasks.rs | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index 453dbccb..7f14b5e1 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -5,7 +5,7 @@ use rtic_syntax::{ast::App, Context}; use crate::{ analyze::Analysis, check::Extra, - codegen::{locals, module, resources_struct, util}, + codegen::{locals, module, resources_struct}, }; /// Generate support code for hardware tasks (`#[exception]`s and `#[interrupt]`s) @@ -29,10 +29,7 @@ pub fn codegen( let mut user_tasks = vec![]; for (name, task) in &app.hardware_tasks { - let core = task.args.core; - let cfg_core = util::cfg_core(core, app.args.cores); - - let (let_instant, instant) = if app.uses_schedule(core) { + let (let_instant, instant) = if app.uses_schedule() { let m = extra.monotonic(); ( @@ -49,19 +46,12 @@ pub fn codegen( quote!(#name::Locals::new(),) }; - let symbol = if cfg!(feature = "homogeneous") { - util::suffixed(&task.args.binds.to_string(), core) - } else { - task.args.binds.clone() - }; + let symbol = task.args.binds.clone(); let priority = task.args.priority; - let section = util::link_section("text", core); const_app.push(quote!( #[allow(non_snake_case)] #[no_mangle] - #section - #cfg_core unsafe fn #symbol() { const PRIORITY: u8 = #priority; @@ -103,8 +93,7 @@ pub fn codegen( // `${task}Locals` let mut locals_pat = None; if !task.locals.is_empty() { - let (struct_, pat) = - locals::codegen(Context::HardwareTask(name), &task.locals, core, app); + let (struct_, pat) = locals::codegen(Context::HardwareTask(name), &task.locals, app); root.push(struct_); locals_pat = Some(pat); @@ -113,13 +102,10 @@ pub fn codegen( let attrs = &task.attrs; let context = &task.context; let stmts = &task.stmts; - let section = util::link_section("text", core); - // XXX shouldn't this have a cfg_core? let locals_pat = locals_pat.iter(); user_tasks.push(quote!( #(#attrs)* #[allow(non_snake_case)] - #section fn #name(#(#locals_pat,)* #context: #name::Context) { use rtic::Mutex as _; |