diff options
author | 2017-03-10 20:35:52 -0500 | |
---|---|---|
committer | 2017-03-10 20:35:52 -0500 | |
commit | 81c9d39ebc8e73baa396a60eb8d9f717a74b96f0 (patch) | |
tree | d444eec8a224c0e84da95a02fdf56ebbb6ae6cae /src/peripheral/mod.rs | |
parent | f2d4e38af794be833f21948a2a4837a2ff4cadd9 (diff) | |
download | cortex-m-81c9d39ebc8e73baa396a60eb8d9f717a74b96f0.tar.gz cortex-m-81c9d39ebc8e73baa396a60eb8d9f717a74b96f0.tar.zst cortex-m-81c9d39ebc8e73baa396a60eb8d9f717a74b96f0.zip |
CsCtxt renamed to CriticalSection. Mutex.lock removed in favor of Mutex.borrow
Diffstat (limited to 'src/peripheral/mod.rs')
-rw-r--r-- | src/peripheral/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/peripheral/mod.rs b/src/peripheral/mod.rs index f47baf5..f9ee217 100644 --- a/src/peripheral/mod.rs +++ b/src/peripheral/mod.rs @@ -10,7 +10,7 @@ use core::ptr; use volatile_register::{RO, RW, WO}; -use interrupt::{CsCtxt, Nr}; +use interrupt::{CriticalSection, Nr}; #[cfg(test)] mod test; @@ -69,8 +69,8 @@ impl<T> Peripheral<T> { } } - /// Borrows the peripheral for the duration of the critical section - pub fn borrow<'cs>(&self, _ctxt: &'cs CsCtxt) -> &'cs T { + /// Borrows the peripheral for the duration of a critical section + pub fn borrow<'cs>(&self, _ctxt: &'cs CriticalSection) -> &'cs T { unsafe { &*self.get() } } |