Cleanup from review (needs releases to compile)

This commit is contained in:
Emil Fresk 2021-07-08 23:18:44 +02:00
parent 98d2af9d73
commit 8f37043782
13 changed files with 11 additions and 218 deletions

View file

@ -23,4 +23,4 @@ proc-macro-error = "1"
quote = "1"
syn = "1"
# rtic-syntax = "0.5.0-alpha.3"
rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax.git", branch = "resources_take_2" }
rtic-syntax = { git = "https://github.com/rtic-rs/rtic-syntax.git" }

View file

@ -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!());

View file

@ -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;

View file

@ -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

View file

@ -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!(

View file

@ -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]))
}