aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Fresk <emil.fresk@gmail.com>2023-02-20 20:56:18 +0100
committerHenrik Tjäder <henrik@tjaders.com>2023-03-01 00:35:21 +0100
commit4442c4692634c90ba60653d42d72f9f259ae1a16 (patch)
tree9d9febd21d6caf64011c30404808efb043028181
parent9552790dcc5c8469c6c297b0277a83d2c145b56b (diff)
Update backend features to be more clear
-rw-r--r--rtic-macros/Cargo.toml11
-rw-r--r--rtic-macros/src/codegen/bindings.rs14
-rw-r--r--rtic-macros/src/codegen/bindings/cortex.rs8
-rw-r--r--rtic/Cargo.toml14
-rw-r--r--rtic/src/export.rs8
-rw-r--r--xtask/src/main.rs8
6 files changed, 31 insertions, 32 deletions
diff --git a/rtic-macros/Cargo.toml b/rtic-macros/Cargo.toml
index bdc2c12..94aa88b 100644
--- a/rtic-macros/Cargo.toml
+++ b/rtic-macros/Cargo.toml
@@ -23,16 +23,15 @@ proc-macro = true
[features]
default = []
-debugprint = []
# list of supported codegen backends
-cortex_m_source_masking = []
-cortex_m_basepri = []
-# riscv_clic = []
-# riscv_ch32 = []
+cortex-m-source-masking = []
+cortex-m-basepri = []
+# riscv-clic = []
+# riscv-ch32 = []
# backend API test
-test_template = []
+test-template = []
[dependencies]
indexmap = "1.9.2"
diff --git a/rtic-macros/src/codegen/bindings.rs b/rtic-macros/src/codegen/bindings.rs
index a187820..68378b5 100644
--- a/rtic-macros/src/codegen/bindings.rs
+++ b/rtic-macros/src/codegen/bindings.rs
@@ -1,18 +1,18 @@
#[cfg(not(any(
- feature = "cortex_m_source_masking",
- feature = "cortex_m_basepri",
- feaute = "test_template"
+ feature = "cortex-m-source-masking",
+ feature = "cortex-m-basepri",
+ feaute = "test-template"
)))]
compile_error!("No backend selected");
-#[cfg(any(feature = "cortex_m_source_masking", feature = "cortex_m_basepri"))]
+#[cfg(any(feature = "cortex-m-source-masking", feature = "cortex-m-basepri"))]
pub use cortex::*;
-#[cfg(feature = "test_template")]
+#[cfg(feature = "test-template")]
pub use cortex::*;
-#[cfg(any(feature = "cortex_m_source_masking", feature = "cortex_m_basepri"))]
+#[cfg(any(feature = "cortex-m-source-masking", feature = "cortex-m-basepri"))]
mod cortex;
-#[cfg(feature = "test_template")]
+#[cfg(feature = "test-template")]
mod template;
diff --git a/rtic-macros/src/codegen/bindings/cortex.rs b/rtic-macros/src/codegen/bindings/cortex.rs
index d5eb12e..3f0584c 100644
--- a/rtic-macros/src/codegen/bindings/cortex.rs
+++ b/rtic-macros/src/codegen/bindings/cortex.rs
@@ -8,9 +8,9 @@ use quote::quote;
use std::collections::HashSet;
use syn::{parse, Attribute, Ident};
-#[cfg(feature = "cortex_m_basepri")]
+#[cfg(feature = "cortex-m-basepri")]
pub use basepri::*;
-#[cfg(feature = "cortex_m_source_masking")]
+#[cfg(feature = "cortex-m-source-masking")]
pub use source_masking::*;
/// Whether `name` is an exception with configurable priority
@@ -30,7 +30,7 @@ fn is_exception(name: &Ident) -> bool {
)
}
-#[cfg(feature = "cortex_m_source_masking")]
+#[cfg(feature = "cortex-m-source-masking")]
mod source_masking {
use super::*;
use std::collections::HashMap;
@@ -119,7 +119,7 @@ mod source_masking {
}
}
-#[cfg(feature = "cortex_m_basepri")]
+#[cfg(feature = "cortex-m-basepri")]
mod basepri {
use super::*;
diff --git a/rtic/Cargo.toml b/rtic/Cargo.toml
index 4448fd3..51a580e 100644
--- a/rtic/Cargo.toml
+++ b/rtic/Cargo.toml
@@ -65,13 +65,13 @@ trybuild = "1"
[features]
default = []
-thumbv6 = ["rtic-macros/cortex_m_source_masking"]
-thumbv7 = ["rtic-macros/cortex_m_basepri"]
-thumbv8_base = ["rtic-macros/cortex_m_source_masking"]
-thumbv8_main = ["rtic-macros/cortex_m_basepri"]
-# riscv_clic = ["rtic-macros/riscv_clic"]
-# riscv_ch32 = ["rtic-macros/riscv_ch32"]
-# riscv_esp32c3 = ["rtic-macros/riscv_esp32c3"]
+thumbv6-backend = ["rtic-macros/cortex-m-source-masking"]
+thumbv7-backend = ["rtic-macros/cortex-m-basepri"]
+thumbv8base-backend = ["rtic-macros/cortex-m-source-masking"]
+thumbv8main-backend = ["rtic-macros/cortex-m-basepri"]
+# riscv-clic-backend = ["rtic-macros/riscv-clic"]
+# riscv-ch32-backend = ["rtic-macros/riscv-ch32"]
+# riscv-esp32c3-backend = ["rtic-macros/riscv-esp32c3"]
# needed for testing
test-critical-section = ["cortex-m/critical-section-single-core", "rtic-monotonics/systick_100hz"]
diff --git a/rtic/src/export.rs b/rtic/src/export.rs
index 2ce8ce2..82132c2 100644
--- a/rtic/src/export.rs
+++ b/rtic/src/export.rs
@@ -6,18 +6,18 @@ pub mod executor;
#[cfg(all(
cortex_m_basepri,
- not(any(feature = "thumbv7", feature = "thumbv8_main"))
+ not(any(feature = "thumbv7-backend", feature = "thumbv8main-backend"))
))]
compile_error!(
- "Building for Cortex-M with basepri, but 'thumbv7' or 'thumbv8_main' backend not selected"
+ "Building for Cortex-M with basepri, but 'thumbv7-backend' or 'thumbv8main-backend' backend not selected"
);
#[cfg(all(
cortex_m_source_masking,
- not(any(feature = "thumbv6", feature = "thumbv8_base"))
+ not(any(feature = "thumbv6-backend", feature = "thumbv8base-backend"))
))]
compile_error!(
- "Building for Cortex-M with source masking, but 'thumbv6' or 'thumbv8_base' backend not selected"
+ "Building for Cortex-M with source masking, but 'thumbv6-backend' or 'thumbv8base-backend' backend not selected"
);
#[cfg(cortex_m_basepri)]
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index b270a44..9ff0ae2 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -55,10 +55,10 @@ impl Backends {
fn to_rtic_feature(&self) -> &str {
match self {
- Backends::Thumbv6 => "thumbv6",
- Backends::Thumbv7 => "thumbv7",
- Backends::Thumbv8Base => "thumbv8_base",
- Backends::Thumbv8Main => "thumbv8_main",
+ Backends::Thumbv6 => "thumbv6-backend",
+ Backends::Thumbv7 => "thumbv7-backend",
+ Backends::Thumbv8Base => "thumbv8base-backend",
+ Backends::Thumbv8Main => "thumbv8main-backend",
}
}
}