aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <japaricious@gmail.com> 2017-04-19 15:03:49 -0500
committerGravatar Jorge Aparicio <japaricious@gmail.com> 2017-04-19 15:03:49 -0500
commitaee3c2b29b9c47d5b359cc8ef56fcd0d9a9ba15d (patch)
tree746ddfc1d8904e469a67e87964accdac62584d90 /src/lib.rs
parentaee1d785a914365e64462ce507e27ca917da9055 (diff)
downloadrtic-aee3c2b29b9c47d5b359cc8ef56fcd0d9a9ba15d.tar.gz
rtic-aee3c2b29b9c47d5b359cc8ef56fcd0d9a9ba15d.tar.zst
rtic-aee3c2b29b9c47d5b359cc8ef56fcd0d9a9ba15d.zip
critical: don't let the ceiling token escape the critical section
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 280c8c20..f84d1d15 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -238,12 +238,12 @@ where
/// No task can preempt this critical section
pub fn critical<R, F>(f: F) -> R
where
- F: FnOnce(CMAX) -> R,
+ F: FnOnce(&CMAX) -> R,
{
let primask = ::cortex_m::register::primask::read();
::cortex_m::interrupt::disable();
- let r = f(C { _marker: PhantomData });
+ let r = f(&C { _marker: PhantomData });
// If the interrupts were active before our `disable` call, then re-enable
// them. Otherwise, keep them disabled