diff options
author | 2023-10-16 01:33:34 +0100 | |
---|---|---|
committer | 2023-10-16 01:57:48 +0100 | |
commit | 0a701d68b51da9468a9a5e518667d4c037102e85 (patch) | |
tree | ea97c5f9726b46e5f9aef2721208645fa37d9750 /src/critical_section.rs | |
parent | c52330f333afe5358b5b6cccb4837eeb92af2759 (diff) | |
download | cortex-m-0a701d68b51da9468a9a5e518667d4c037102e85.tar.gz cortex-m-0a701d68b51da9468a9a5e518667d4c037102e85.tar.zst cortex-m-0a701d68b51da9468a9a5e518667d4c037102e85.zip |
Move cortex-m crate into cortex-m directory
Diffstat (limited to 'src/critical_section.rs')
-rw-r--r-- | src/critical_section.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/critical_section.rs b/src/critical_section.rs deleted file mode 100644 index e3d57d1..0000000 --- a/src/critical_section.rs +++ /dev/null @@ -1,22 +0,0 @@ -use critical_section::{set_impl, Impl, RawRestoreState}; - -use crate::interrupt; -use crate::register::primask; - -struct SingleCoreCriticalSection; -set_impl!(SingleCoreCriticalSection); - -unsafe impl Impl for SingleCoreCriticalSection { - unsafe fn acquire() -> RawRestoreState { - let was_active = primask::read().is_active(); - interrupt::disable(); - was_active - } - - unsafe fn release(was_active: RawRestoreState) { - // Only re-enable interrupts if they were enabled before the critical section. - if was_active { - interrupt::enable() - } - } -} |