Skip to content

Commit f6022e7

Browse files
authored
Merge pull request #3282 from c1728p9/fix_nvic
Ensure isr cannot occur after NVIC_DisableIRQ
2 parents e07fcda + cf5cd7d commit f6022e7

File tree

7 files changed

+14
-0
lines changed

7 files changed

+14
-0
lines changed

cmsis/core_cm0.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
589589
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
590590
{
591591
NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
592+
__DSB();
593+
__ISB();
592594
}
593595

594596

cmsis/core_cm0plus.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,8 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
703703
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
704704
{
705705
NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
706+
__DSB();
707+
__ISB();
706708
}
707709

708710

cmsis/core_cm3.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,6 +1431,8 @@ __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
14311431
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
14321432
{
14331433
NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1434+
__DSB();
1435+
__ISB();
14341436
}
14351437

14361438

cmsis/core_cm4.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,6 +1597,8 @@ __STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
15971597
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
15981598
{
15991599
NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1600+
__DSB();
1601+
__ISB();
16001602
}
16011603

16021604

cmsis/core_cm7.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,6 +1754,8 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
17541754
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
17551755
{
17561756
NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1757+
__DSB();
1758+
__ISB();
17571759
}
17581760

17591761

cmsis/core_sc000.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,8 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
705705
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
706706
{
707707
NVIC->ICER[0] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
708+
__DSB();
709+
__ISB();
708710
}
709711

710712

cmsis/core_sc300.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,8 @@ __STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
13761376
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
13771377
{
13781378
NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL));
1379+
__DSB();
1380+
__ISB();
13791381
}
13801382

13811383

0 commit comments

Comments
 (0)