From aee3c2b29b9c47d5b359cc8ef56fcd0d9a9ba15d Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Wed, 19 Apr 2017 15:03:49 -0500 Subject: critical: don't let the ceiling token escape the critical section --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 280c8c2..f84d1d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -238,12 +238,12 @@ where /// No task can preempt this critical section pub fn critical(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 -- cgit v1.2.3