diff --git a/Cargo.toml b/Cargo.toml index 922385c943..61f8e56eb2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,3 +70,10 @@ overflow-checks = false [patch.crates-io] lm3s6965 = { git = "https://github.com/japaric/lm3s6965" } + +[features] +test-critical-section = ["cortex-m/critical-section-single-core"] + +[[example]] +name = "pool" +required-features = ["test-critical-section"] diff --git a/macros/src/codegen/shared_resources.rs b/macros/src/codegen/shared_resources.rs index 4a75007075..b5dff09da1 100644 --- a/macros/src/codegen/shared_resources.rs +++ b/macros/src/codegen/shared_resources.rs @@ -147,6 +147,7 @@ pub fn codegen( None } })) { + #[allow(clippy::or_fun_call)] let v = prio_to_masks.entry(priority - 1).or_insert(Vec::new()); v.push(quote!(#device::Interrupt::#name as u32)); mask_ids.push(quote!(#device::Interrupt::#name as u32)); diff --git a/xtask/src/command.rs b/xtask/src/command.rs index 2f719bf5c9..100888c075 100644 --- a/xtask/src/command.rs +++ b/xtask/src/command.rs @@ -46,7 +46,15 @@ impl<'a> CargoCommand<'a> { features, mode, } => { - let mut args = vec![self.name(), "--example", example, "--target", target]; + let mut args = vec![ + self.name(), + "--example", + example, + "--target", + target, + "--features", + "test-critical-section", + ]; if let Some(feature_name) = features { args.extend_from_slice(&["--features", feature_name]);