From be92041a592f65f38cee8475b61d35e7fcee3694 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 29 Jun 2019 09:11:42 +0200 Subject: WIP --- macros/src/codegen/hardware_tasks.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 a7af510a..cf92e078 100644 --- a/macros/src/codegen/hardware_tasks.rs +++ b/macros/src/codegen/hardware_tasks.rs @@ -56,9 +56,11 @@ pub fn codegen( }; 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; @@ -101,7 +103,8 @@ 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, core, app); root.push(struct_); locals_pat = Some(pat); @@ -110,9 +113,12 @@ 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? user_tasks.push(quote!( #(#attrs)* #[allow(non_snake_case)] + #section fn #name(#(#locals_pat,)* #context: #name::Context) { use rtfm::Mutex as _; -- cgit v1.2.3