aboutsummaryrefslogtreecommitdiff
path: root/src/exception.rs
diff options
context:
space:
mode:
authorGravatar homunkulus <homunkulus@gmx.com> 2017-12-09 10:03:39 +0000
committerGravatar homunkulus <homunkulus@gmx.com> 2017-12-09 10:03:39 +0000
commitce5bee6e37b4127040224523a1af85c275401a18 (patch)
treebc6033773fa2c8959d6de6d8b673902141f17c84 /src/exception.rs
parent7e05e189c5195303f8693d442b71754f956fc81f (diff)
parent0b45ea4bd486565da5d78793dcb4718afb4f4387 (diff)
downloadcortex-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.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,