diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -436,7 +436,7 @@ extern crate typenum; use core::cell::UnsafeCell; use core::marker::PhantomData; -use core::ptr; +use core::{mem, ptr}; use cortex_m::ctxt::Context; use cortex_m::interrupt::Nr; @@ -719,6 +719,15 @@ pub struct P<T> { _marker: PhantomData<T>, } +impl<N> P<N> { + /// Turns this priority into a ceiling + pub fn as_ceiling(&self) -> &C<N> { + unsafe { + mem::transmute(self) + } + } +} + impl<T> P<T> where T: Unsigned, |
