From a99c5c60485f7af2b62f8839ebb04605e15a7f9b Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Tue, 5 Apr 2016 19:17:44 +0900 Subject: [PATCH] fix struct NVIC --- ChangeLog | 4 ++++ chopstx.c | 12 ++++++------ 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 + + * chopstx.c (struct NVIC): Add volatile qualifier to members. + 2016-03-08 Niibe Yutaka * 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;