diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d1a9f3d5f40..95e445300050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ For each category, *Added*, *Changed*, *Fixed* add new entries at the top! - `examples/periodic-at2.rs`, an example of a periodic process with two tasks, with offset timing. Here we depict two alternative usages of the timer type, explicit and trait based. - book: Update `Monotonic` tips. +- rename lock types `{}_lock` (instead of `{}_that_needs_to_be_locked`) +- change visibility of `app::shared_resources` module to pub ### Fixed diff --git a/macros/src/codegen/shared_resources.rs b/macros/src/codegen/shared_resources.rs index 4a750070756f..4b303086b9da 100644 --- a/macros/src/codegen/shared_resources.rs +++ b/macros/src/codegen/shared_resources.rs @@ -49,7 +49,7 @@ pub fn codegen( // For future use // let doc = format!(" RTIC internal: {}:{}", file!(), line!()); - let shared_name = util::need_to_lock_ident(name); + let shared_name = util::lock_ident(name); if !res.properties.lock_free { mod_resources.push(quote!( @@ -104,7 +104,7 @@ pub fn codegen( let mod_resources = if mod_resources.is_empty() { quote!() } else { - quote!(mod shared_resources { + quote!(pub mod shared_resources { use rtic::export::Priority; #(#mod_resources)* diff --git a/macros/src/codegen/shared_resources_struct.rs b/macros/src/codegen/shared_resources_struct.rs index 90cbc1beef72..7b3f3a2ffea7 100644 --- a/macros/src/codegen/shared_resources_struct.rs +++ b/macros/src/codegen/shared_resources_struct.rs @@ -33,7 +33,7 @@ pub fn codegen(ctxt: Context, needs_lt: &mut bool, app: &App) -> (TokenStream2, }; let ty = &res.ty; let mangled_name = util::static_shared_resource_ident(name); - let shared_name = util::need_to_lock_ident(name); + let shared_name = util::lock_ident(name); if res.properties.lock_free { // Lock free resources of `idle` and `init` get 'static lifetime diff --git a/macros/src/codegen/util.rs b/macros/src/codegen/util.rs index 0a3edc20d2f5..bd838153eca0 100644 --- a/macros/src/codegen/util.rs +++ b/macros/src/codegen/util.rs @@ -270,8 +270,8 @@ pub fn declared_static_local_resource_ident(name: &Ident, task_name: &Ident) -> mark_internal_name(&format!("local_{}_{}", task_name, name)) } -pub fn need_to_lock_ident(name: &Ident) -> Ident { - Ident::new(&format!("{}_that_needs_to_be_locked", name), name.span()) +pub fn lock_ident(name: &Ident) -> Ident { + Ident::new(&format!("{}_lock", name), name.span()) } /// The name to get better RT flag errors