aboutsummaryrefslogtreecommitdiff
path: root/src/peripheral/nvic.rs
diff options
context:
space:
mode:
authorGravatar Jorge Aparicio <jorge@japaric.io> 2018-05-11 18:38:55 +0200
committerGravatar Jorge Aparicio <jorge@japaric.io> 2018-05-11 18:38:55 +0200
commitc290aa4ee89951a0ea503b129f6c5bd3d47a663d (patch)
tree4fff84f983533692452de111357944d591809622 /src/peripheral/nvic.rs
parent716398ce542798aff238abc6a978d3b64a1c0dd4 (diff)
downloadcortex-m-c290aa4ee89951a0ea503b129f6c5bd3d47a663d.tar.gz
cortex-m-c290aa4ee89951a0ea503b129f6c5bd3d47a663d.tar.zst
cortex-m-c290aa4ee89951a0ea503b129f6c5bd3d47a663d.zip
ARMv6-M: remove fields that are not available from NVIC and SCB
Diffstat (limited to 'src/peripheral/nvic.rs')
-rw-r--r--src/peripheral/nvic.rs29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/peripheral/nvic.rs b/src/peripheral/nvic.rs
index 7ce31ba..1a6a027 100644
--- a/src/peripheral/nvic.rs
+++ b/src/peripheral/nvic.rs
@@ -1,6 +1,8 @@
//! Nested Vector Interrupt Controller
-use volatile_register::{RO, RW};
+#[cfg(not(armv6m))]
+use volatile_register::RO;
+use volatile_register::RW;
use interrupt::Nr;
use peripheral::NVIC;
@@ -10,19 +12,31 @@ use peripheral::NVIC;
pub struct RegisterBlock {
/// Interrupt Set-Enable
pub iser: [RW<u32>; 16],
- reserved0: [u32; 16],
+
+ _reserved0: [u32; 16],
+
/// Interrupt Clear-Enable
pub icer: [RW<u32>; 16],
- reserved1: [u32; 16],
+
+ _reserved1: [u32; 16],
+
/// Interrupt Set-Pending
pub ispr: [RW<u32>; 16],
- reserved2: [u32; 16],
+
+ _reserved2: [u32; 16],
+
/// Interrupt Clear-Pending
pub icpr: [RW<u32>; 16],
- reserved3: [u32; 16],
- /// Interrupt Active Bit
+
+ _reserved3: [u32; 16],
+
+ /// Interrupt Active Bit (not present on Cortex-M0 variants)
+ #[cfg(not(armv6m))]
pub iabr: [RO<u32>; 16],
- reserved4: [u32; 48],
+ #[cfg(armv6m)]
+ _reserved4: [u32; 16],
+
+ _reserved5: [u32; 48],
#[cfg(not(armv6m))]
/// Interrupt Priority
@@ -110,6 +124,7 @@ impl NVIC {
}
/// Is `interrupt` active or pre-empted and stacked
+ #[cfg(not(armv6m))]
pub fn is_active<I>(interrupt: I) -> bool
where
I: Nr,