aboutsummaryrefslogtreecommitdiff
path: root/src/exception.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2017-11-21 15:56:16 +0100
committerGravatar Jorge Aparicio <jorge@japaric.io> 2017-11-21 15:56:16 +0100
commitc6ed9ef43f6606f654c2392413ca8ed380a35056 (patch)
treed0291cc25ae95b99089fca9fb49c5b5826757413 /src/exception.rs
parent7e05e189c5195303f8693d442b71754f956fc81f (diff)
downloadcortex-m-c6ed9ef43f6606f654c2392413ca8ed380a35056.tar.gz
cortex-m-c6ed9ef43f6606f654c2392413ca8ed380a35056.tar.zst
cortex-m-c6ed9ef43f6606f654c2392413ca8ed380a35056.zip
turn peripherals into scoped singletons
Diffstat (limited to 'src/exception.rs')
-rw-r--r--src/exception.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/exception.rs b/src/exception.rs
index 3052f66..7203dfa 100644
--- a/src/exception.rs
+++ b/src/exception.rs
@@ -31,8 +31,8 @@ impl Exception {
///
/// Returns `None` if no exception is currently active
pub fn active() -> Option<Exception> {
- // NOTE(safe) atomic read
- let icsr = unsafe { (*::peripheral::SCB.get()).icsr.read() };
+ // NOTE(safe) atomic read with no side effects
+ let icsr = unsafe { (*::peripheral::SCB::ptr()).icsr.read() };
Some(match icsr as u8 {
0 => return None,