aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jamie McClymont <jamie@kwiius.com> 2019-09-21 04:43:59 +1200
committerGravatar Jamie McClymont <jamie@kwiius.com> 2019-09-21 04:58:25 +1200
commit6b70f5266b30d70c5c146f2d8e13f7a139d0c526 (patch)
treefb80379c3f13ef1767177dc3aa95022914fae26e
parent718cd17aadda36edf3dff761e55a580e54e355df (diff)
downloadcortex-m-6b70f5266b30d70c5c146f2d8e13f7a139d0c526.tar.gz
cortex-m-6b70f5266b30d70c5c146f2d8e13f7a139d0c526.tar.zst
cortex-m-6b70f5266b30d70c5c146f2d8e13f7a139d0c526.zip
Deprecate nonexistent registers on thumbv8m.base
First step in resolving #155
-rw-r--r--build.rs1
-rw-r--r--src/register/mod.rs27
2 files changed, 25 insertions, 3 deletions
diff --git a/build.rs b/build.rs
index 3ca7ddf..cf820cb 100644
--- a/build.rs
+++ b/build.rs
@@ -29,6 +29,7 @@ fn main() {
} else if target.starts_with("thumbv8m.base") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv8m");
+ println!("cargo:rustc-cfg=armv8m_base");
} else if target.starts_with("thumbv8m.main") {
println!("cargo:rustc-cfg=cortex_m");
println!("cargo:rustc-cfg=armv8m");
diff --git a/src/register/mod.rs b/src/register/mod.rs
index 854d725..e7879c5 100644
--- a/src/register/mod.rs
+++ b/src/register/mod.rs
@@ -26,15 +26,36 @@
//!
//! - Cortex-M* Devices Generic User Guide - Section 2.1.3 Core registers
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
pub mod basepri;
-#[cfg(not(armv6m))]
+#[cfg(armv8m_base)]
+#[deprecated(
+ since = "0.6.2",
+ note = "basepri is unavailable on thumbv8.base, and will be removed in the next release"
+)]
+pub mod basepri;
+
+#[cfg(all(not(armv6m), not(armv8m_base)))]
+pub mod basepri_max;
+
+#[cfg(armv8m_base)]
+#[deprecated(
+ since = "0.6.2",
+ note = "basepri is unavailable on thumbv8m.base, and will be removed in the next release"
+)]
pub mod basepri_max;
pub mod control;
-#[cfg(not(armv6m))]
+#[cfg(all(not(armv6m), not(armv8m_base)))]
+pub mod faultmask;
+
+#[cfg(armv8m_base)]
+#[deprecated(
+ since = "0.6.2",
+ note = "faultmask is unavailable on thumbv8m.base, and will be removed in the next release"
+)]
pub mod faultmask;
pub mod msp;