diff --git a/rtic/Cargo.toml b/rtic/Cargo.toml index ccda992e6c..9f6d24dded 100644 --- a/rtic/Cargo.toml +++ b/rtic/Cargo.toml @@ -74,7 +74,8 @@ thumbv8main-backend = ["rtic-macros/cortex-m-basepri"] # riscv-esp32c3-backend = ["rtic-macros/riscv-esp32c3"] # needed for testing -rtic-uitest = ["thumbv7-backend","rtic-macros/cortex-m-basepri"] +rtic-uitestv7 = ["thumbv7-backend", "rtic-macros/cortex-m-basepri"] +rtic-uitestv6 = ["thumbv6-backend", "rtic-macros/cortex-m-source-masking"] test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick-100hz"] # [[example]] diff --git a/rtic/src/export.rs b/rtic/src/export.rs index 86e9c3a875..9040b63962 100644 --- a/rtic/src/export.rs +++ b/rtic/src/export.rs @@ -20,23 +20,24 @@ compile_error!( "Building for Cortex-M with source masking, but 'thumbv6-backend' or 'thumbv8base-backend' backend not selected" ); -#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitest"))] +#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitestv7"))] pub use cortex_basepri::*; -#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitest"))] +#[cfg(any(feature = "cortex-m-basepri", feature = "rtic-uitestv7"))] mod cortex_basepri; -#[cfg(feature = "cortex-m-source-masking")] +#[cfg(any(feature = "cortex-m-source-masking", feature = "rtic-uitestv6"))] pub use cortex_source_mask::*; -#[cfg(feature = "cortex-m-source-masking")] +#[cfg(any(feature = "cortex-m-source-masking", feature = "rtic-uitestv6"))] mod cortex_source_mask; /// Priority conversion, takes logical priorities 1..=N and converts it to NVIC priority. #[cfg(any( feature = "cortex-m-basepri", feature = "cortex-m-source-masking", - feature = "rtic-uitest", + feature = "rtic-uitestv6", + feature = "rtic-uitestv7", ))] #[inline] #[must_use] diff --git a/xtask/src/argument_parsing.rs b/xtask/src/argument_parsing.rs index 3e5afc3402..70bae73354 100644 --- a/xtask/src/argument_parsing.rs +++ b/xtask/src/argument_parsing.rs @@ -41,7 +41,7 @@ impl TestMetadata { "{},{},{}", DEFAULT_FEATURES, backend.to_rtic_feature(), - "rtic-uitest" + backend.to_rtic_uitest_feature(), )); CargoCommand::Test { package: Some(package), @@ -110,10 +110,15 @@ impl Backends { #[allow(clippy::wrong_self_convention)] pub fn to_rtic_macros_feature(&self) -> &str { match self { - Backends::Thumbv6 => "cortex-m-source-masking", - Backends::Thumbv7 => "cortex-m-basepri", - Backends::Thumbv8Base => "cortex-m-source-masking", - Backends::Thumbv8Main => "cortex-m-basepri", + Backends::Thumbv6 | Backends::Thumbv8Base => "cortex-m-source-masking", + Backends::Thumbv7 | Backends::Thumbv8Main => "cortex-m-basepri", + } + } + #[allow(clippy::wrong_self_convention)] + pub fn to_rtic_uitest_feature(&self) -> &str { + match self { + Backends::Thumbv6 | Backends::Thumbv8Base => "rtic-uitestv6", + Backends::Thumbv7 | Backends::Thumbv8Main => "rtic-uitestv7", } } }