From 6b70f5266b30d70c5c146f2d8e13f7a139d0c526 Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Sat, 21 Sep 2019 04:43:59 +1200 Subject: [PATCH 1/2] Deprecate nonexistent registers on thumbv8m.base First step in resolving #155 --- build.rs | 1 + src/register/mod.rs | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 3ca7ddf3..cf820cbf 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 854d7256..e7879c5c 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; From 36651038cc66fc52b9719c23c3cd95792c8b025f Mon Sep 17 00:00:00 2001 From: Jamie McClymont Date: Sun, 22 Sep 2019 04:30:40 +1200 Subject: [PATCH 2/2] Changelog entry for thumbv8.base register deprecations --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d44da60..c4a4a2d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Deprecation + +- Deprecated incorrectly included registers (`BASPRI`, `BASEPRI_MAX`, `FAULTMASK`) on `thumbv8.base` + ## [v0.6.1] - 2019-08-21 ### Fixed