diff options
author | 2022-08-11 01:49:33 +0200 | |
---|---|---|
committer | 2022-08-11 23:31:08 +0200 | |
commit | 3a15a6b4b320fa328e8ab99c31f81536960dd280 (patch) | |
tree | 4c3ef55e91988845873479460e438afea445c919 /src/peripheral/mod.rs | |
parent | 4e908625204a1e95dd3fd5bdcd8d66d6bc11c3bc (diff) | |
download | cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.tar.gz cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.tar.zst cortex-m-3a15a6b4b320fa328e8ab99c31f81536960dd280.zip |
Add implementation for critical-section 1.0
Co-Authored-By: Markus Reiter <me@reitermark.us>
Diffstat (limited to 'src/peripheral/mod.rs')
-rw-r--r-- | src/peripheral/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index c316886..bf18151 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -57,7 +57,6 @@ //! //! - ARMv7-M Architecture Reference Manual (Issue E.b) - Chapter B3 -use crate::interrupt; use core::marker::PhantomData; use core::ops; @@ -164,7 +163,7 @@ impl Peripherals { /// Returns all the core peripherals *once* #[inline] pub fn take() -> Option<Self> { - interrupt::free(|_| { + critical_section::with(|_| { if unsafe { TAKEN } { None } else { |