aboutsummaryrefslogtreecommitdiff
path: root/src/interrupt.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2017-05-07 16:44:04 -0500
committerGravatar Jorge Aparicio <jorge@japaric.io> 2017-05-07 16:44:30 -0500
commit70b967629e31a9d6581ea5fc14d2880f0cc32eab (patch)
tree374623964bb7c75d8da5ebc6944cf3e0876e4afb /src/interrupt.rs
parent0e3dd2df58e52f9af80e47327a62a83511e010f9 (diff)
downloadcortex-m-70b967629e31a9d6581ea5fc14d2880f0cc32eab.tar.gz
cortex-m-70b967629e31a9d6581ea5fc14d2880f0cc32eab.tar.zst
cortex-m-70b967629e31a9d6581ea5fc14d2880f0cc32eab.zip
make `interrupt::enable` unsafe
closes #23
Diffstat (limited to 'src/interrupt.rs')
-rw-r--r--src/interrupt.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/interrupt.rs b/src/interrupt.rs
index a4eac00..412c483 100644
--- a/src/interrupt.rs
+++ b/src/interrupt.rs
@@ -47,8 +47,12 @@ pub fn disable() {
}
/// Enables all the interrupts
+///
+/// # Safety
+///
+/// - Do not call this function inside an `interrupt::free` critical section
#[inline(always)]
-pub fn enable() {
+pub unsafe fn enable() {
match () {
#[cfg(target_arch = "arm")]
() => unsafe {
@@ -87,7 +91,7 @@ where
// If the interrupts were active before our `disable` call, then re-enable
// them. Otherwise, keep them disabled
if primask.is_active() {
- enable();
+ unsafe { enable() }
}
r