From 76cf14c520091d00985f845203580e14c611ed14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 27 Aug 2020 11:21:56 +0000 Subject: Brutally yank out multicore --- macros/src/codegen/hardware_tasks.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'macros/src/codegen/hardware_tasks.rs') diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index 453dbcc..37df33d 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -29,10 +29,8 @@ 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 +47,14 @@ 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); + let section = util::link_section("text"); const_app.push(quote!( #[allow(non_snake_case)] #[no_mangle] #section - #cfg_core unsafe fn #symbol() { const PRIORITY: u8 = #priority; @@ -104,7 +97,7 @@ pub fn codegen( let mut locals_pat = None; if !task.locals.is_empty() { let (struct_, pat) = - locals::codegen(Context::HardwareTask(name), &task.locals, core, app); + locals::codegen(Context::HardwareTask(name), &task.locals, app); root.push(struct_); locals_pat = Some(pat); @@ -113,8 +106,7 @@ 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 section = util::link_section("text"); let locals_pat = locals_pat.iter(); user_tasks.push(quote!( #(#attrs)* -- cgit v1.2.3 From f151d5871c559012173356259030c1dd36a442cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Tue, 1 Sep 2020 14:39:05 +0000 Subject: Cargo fmt --- macros/src/codegen/hardware_tasks.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'macros/src/codegen/hardware_tasks.rs') diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index 37df33d..eb86c8d 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -29,7 +29,6 @@ pub fn codegen( let mut user_tasks = vec![]; for (name, task) in &app.hardware_tasks { - let (let_instant, instant) = if app.uses_schedule() { let m = extra.monotonic(); @@ -96,8 +95,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, app); + let (struct_, pat) = locals::codegen(Context::HardwareTask(name), &task.locals, app); root.push(struct_); locals_pat = Some(pat); -- cgit v1.2.3 From d06cf91acc1126e66002f8884b1e7b7a65a9b24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Tue, 1 Sep 2020 17:04:55 +0000 Subject: Remove stale code, fix comment styling --- macros/src/codegen/hardware_tasks.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'macros/src/codegen/hardware_tasks.rs') diff --git a/macros/src/codegen/hardware_tasks.rs b/macros/src/codegen/hardware_tasks.rs index eb86c8d..7f14b5e 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) @@ -49,11 +49,9 @@ pub fn codegen( let symbol = task.args.binds.clone(); let priority = task.args.priority; - let section = util::link_section("text"); const_app.push(quote!( #[allow(non_snake_case)] #[no_mangle] - #section unsafe fn #symbol() { const PRIORITY: u8 = #priority; @@ -104,12 +102,10 @@ pub fn codegen( let attrs = &task.attrs; let context = &task.context; let stmts = &task.stmts; - let section = util::link_section("text"); 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 _; -- cgit v1.2.3