diff options
author | 2023-12-31 17:47:28 -0800 | |
---|---|---|
committer | 2023-12-31 17:47:28 -0800 | |
commit | bc9ad129837a441453678fb04fd639c7beab4467 (patch) | |
tree | 545238a5ace992de3d1a19267d0ec8f1f2837ba5 | |
parent | bb4a78208323260a161e68b2498438867f971bc5 (diff) | |
download | cortex-m-bc9ad129837a441453678fb04fd639c7beab4467.tar.gz cortex-m-bc9ad129837a441453678fb04fd639c7beab4467.tar.zst cortex-m-bc9ad129837a441453678fb04fd639c7beab4467.zip |
Updates `bare-metal` to 1.0.0v0.7.x
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | src/interrupt.rs | 15 |
2 files changed, 4 insertions, 13 deletions
@@ -16,7 +16,7 @@ edition = "2018" links = "cortex-m" # prevent multiple versions of this crate to be linked together [dependencies] -bare-metal = { version = "0.2.4", features = ["const-fn"] } +bare-metal = "1.0.0" critical-section = { version = "1.0.0", optional = true } volatile-register = "0.2.0" bitfield = "0.13.2" diff --git a/src/interrupt.rs b/src/interrupt.rs index 0fd1284..6bc20c7 100644 --- a/src/interrupt.rs +++ b/src/interrupt.rs @@ -1,6 +1,6 @@ //! Interrupts -pub use bare_metal::{CriticalSection, Mutex, Nr}; +pub use bare_metal::{CriticalSection, Mutex}; /// Trait for enums of external interrupt numbers. /// @@ -23,15 +23,6 @@ pub unsafe trait InterruptNumber: Copy { fn number(self) -> u16; } -/// Implement InterruptNumber for the old bare_metal::Nr trait. -/// This implementation is for backwards compatibility only and will be removed in cortex-m 0.8. -unsafe impl<T: Nr + Copy> InterruptNumber for T { - #[inline] - fn number(self) -> u16 { - self.nr() as u16 - } -} - /// Disables all interrupts #[inline] pub fn disable() { @@ -54,14 +45,14 @@ pub unsafe fn enable() { #[inline] pub fn free<F, R>(f: F) -> R where - F: FnOnce(&CriticalSection) -> R, + F: FnOnce(CriticalSection) -> R, { let primask = crate::register::primask::read(); // disable interrupts disable(); - let r = f(unsafe { &CriticalSection::new() }); + let r = f(unsafe { CriticalSection::new() }); // If the interrupts were active before our `disable` call, then re-enable // them. Otherwise, keep them disabled |