summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-04-05 19:17:44 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2016-04-05 19:17:44 +0900
commita99c5c60485f7af2b62f8839ebb04605e15a7f9b (patch)
treef9b62a09f02514d5f4ba35e67978b189c556197e
parente092a56c17d2f0dc877a1538102705b3fa572aa5 (diff)
fix struct NVIC
-rw-r--r--ChangeLog4
-rw-r--r--chopstx.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d850bfe..ab0c9b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-04-05 Niibe Yutaka <gniibe@fsij.org>
+
+ * chopstx.c (struct NVIC): Add volatile qualifier to members.
+
2016-03-08 Niibe Yutaka <gniibe@fsij.org>
* chopstx.h (CHOPSTX_THREAD_SIZE): Align by 8.
diff --git a/chopstx.c b/chopstx.c
index 6d25269..3ef4353 100644
--- a/chopstx.c
+++ b/chopstx.c
@@ -133,17 +133,17 @@ static uint32_t usec_to_ticks (uint32_t usec)
/* NVIC: Nested Vectored Interrupt Controller. */
struct NVIC {
- uint32_t ISER[8];
+ volatile uint32_t ISER[8];
uint32_t unused1[24];
- uint32_t ICER[8];
+ volatile uint32_t ICER[8];
uint32_t unused2[24];
- uint32_t ISPR[8];
+ volatile uint32_t ISPR[8];
uint32_t unused3[24];
- uint32_t ICPR[8];
+ volatile uint32_t ICPR[8];
uint32_t unused4[24];
- uint32_t IABR[8];
+ volatile uint32_t IABR[8];
uint32_t unused5[56];
- uint32_t IPR[60];
+ volatile uint32_t IPR[60];
};
static struct NVIC *const NVIC = (struct NVIC *const)0xE000E100;