diff options
author | 2021-07-08 23:18:44 +0200 | |
---|---|---|
committer | 2021-07-08 23:18:44 +0200 | |
commit | 8f3704378295fe8007290dbddbc1f4946ac599f9 (patch) | |
tree | 3969e6f6bccfd16e187d7d5ccd56d269d3d9bb9e /macros/src | |
parent | 98d2af9d73da56910c8bb6cb662fbc4d609a704a (diff) | |
download | rtic-8f3704378295fe8007290dbddbc1f4946ac599f9.tar.gz rtic-8f3704378295fe8007290dbddbc1f4946ac599f9.tar.zst rtic-8f3704378295fe8007290dbddbc1f4946ac599f9.zip |
Cleanup from review (needs releases to compile)
Diffstat (limited to 'macros/src')
-rw-r--r-- | macros/src/codegen/local_resources.rs | 2 | ||||
-rw-r--r-- | macros/src/codegen/module.rs | 3 | ||||
-rw-r--r-- | macros/src/codegen/shared_resources.rs | 2 | ||||
-rw-r--r-- | macros/src/codegen/software_tasks.rs | 2 | ||||
-rw-r--r-- | macros/src/codegen/util.rs | 9 |
5 files changed, 5 insertions, 13 deletions
diff --git a/macros/src/codegen/local_resources.rs b/macros/src/codegen/local_resources.rs index c5cddfb3..a9ffa925 100644 --- a/macros/src/codegen/local_resources.rs +++ b/macros/src/codegen/local_resources.rs @@ -28,7 +28,7 @@ pub fn codegen( let attrs = &res.attrs; // late resources in `util::link_section_uninit` - let section = util::link_section_uninit(true); + let section = util::link_section_uninit(); // For future use // let doc = format!(" RTIC internal: {}:{}", file!(), line!()); diff --git a/macros/src/codegen/module.rs b/macros/src/codegen/module.rs index 4fba2f38..a59d6628 100644 --- a/macros/src/codegen/module.rs +++ b/macros/src/codegen/module.rs @@ -198,9 +198,6 @@ pub fn codegen( pub use super::#internal_context_name as Context; )); - // not sure if this is the right way, maybe its backwards, - // that spawn_module should put in in root - if let Context::SoftwareTask(..) = ctxt { let spawnee = &app.software_tasks[name]; let priority = spawnee.args.priority; diff --git a/macros/src/codegen/shared_resources.rs b/macros/src/codegen/shared_resources.rs index d6336b32..181832fd 100644 --- a/macros/src/codegen/shared_resources.rs +++ b/macros/src/codegen/shared_resources.rs @@ -24,7 +24,7 @@ pub fn codegen( let mangled_name = util::mark_internal_ident(&util::static_shared_resource_ident(&name)); // late resources in `util::link_section_uninit` - let section = util::link_section_uninit(true); + let section = util::link_section_uninit(); let attrs = &res.attrs; // For future use diff --git a/macros/src/codegen/software_tasks.rs b/macros/src/codegen/software_tasks.rs index 6941d9a0..cfd21e40 100644 --- a/macros/src/codegen/software_tasks.rs +++ b/macros/src/codegen/software_tasks.rs @@ -45,7 +45,7 @@ pub fn codegen( quote!(rtic::export::Queue(unsafe { rtic::export::iQueue::u8_sc() })), - Box::new(|| util::link_section_uninit(true)), + Box::new(|| util::link_section_uninit()), ) }; mod_app.push(quote!( diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 3b0b9e4f..86bd6955 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -152,13 +152,8 @@ fn link_section_index() -> usize { } // NOTE `None` means in shared memory -pub fn link_section_uninit(empty_expr: bool) -> Option<TokenStream2> { - let section = if empty_expr { - let index = link_section_index(); - format!(".uninit.rtic{}", index) - } else { - format!(".uninit.rtic{}", link_section_index()) - }; +pub fn link_section_uninit() -> Option<TokenStream2> { + let section = format!(".uninit.rtic{}", link_section_index()); Some(quote!(#[link_section = #section])) } |