diff options
author | 2017-12-09 10:03:39 +0000 | |
---|---|---|
committer | 2017-12-09 10:03:39 +0000 | |
commit | ce5bee6e37b4127040224523a1af85c275401a18 (patch) | |
tree | bc6033773fa2c8959d6de6d8b673902141f17c84 /src/exception.rs | |
parent | 7e05e189c5195303f8693d442b71754f956fc81f (diff) | |
parent | 0b45ea4bd486565da5d78793dcb4718afb4f4387 (diff) | |
download | cortex-m-ce5bee6e37b4127040224523a1af85c275401a18.tar.gz cortex-m-ce5bee6e37b4127040224523a1af85c275401a18.tar.zst cortex-m-ce5bee6e37b4127040224523a1af85c275401a18.zip |
Auto merge of #65 - japaric:singletons, r=japaric
turn peripherals into scoped singletons
See this RFC for details: japaric/svd2rust#157
Diffstat (limited to 'src/exception.rs')
-rw-r--r-- | src/exception.rs | 4 |
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, |