diff options
author | 2019-06-29 09:11:42 +0200 | |
---|---|---|
committer | 2019-06-29 09:11:57 +0200 | |
commit | be92041a592f65f38cee8475b61d35e7fcee3694 (patch) | |
tree | 3d7f59dff198183dee3920e790693a93063f3996 /macros/src/codegen/hardware_tasks.rs | |
parent | df4a7fd3e5df370a83fcdc24aa628bed3fa9f543 (diff) | |
download | rtic-be92041a592f65f38cee8475b61d35e7fcee3694.tar.gz rtic-be92041a592f65f38cee8475b61d35e7fcee3694.tar.zst rtic-be92041a592f65f38cee8475b61d35e7fcee3694.zip |
WIP
Diffstat (limited to 'macros/src/codegen/hardware_tasks.rs')
-rw-r--r-- | macros/src/codegen/hardware_tasks.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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 _; |