How can I mask all Interrupts on MK21FN1M0VMC12

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I mask all Interrupts on MK21FN1M0VMC12

Jump to solution
438 Views
brentgreenwald
Contributor III


I see the ARM has a non-maskable interrupt (NMI). Is there an easy way to mask all maskable interrupts, like a single flag or bit?

Labels (2)
0 Kudos
1 Solution
247 Views
BlackNight
NXP Employee
NXP Employee

Hi Brent,

yes, the 'I' bit in the PRIMASK ARM core register. Below how to enable/disable all maskable interrupts:

#define DisableInterrupts()          __asm volatile("cpsid i")
#define EnableInterrrupts()        __asm volatile("cpsie i")

I hope this helps,

Erich

View solution in original post

0 Kudos
1 Reply
248 Views
BlackNight
NXP Employee
NXP Employee

Hi Brent,

yes, the 'I' bit in the PRIMASK ARM core register. Below how to enable/disable all maskable interrupts:

#define DisableInterrupts()          __asm volatile("cpsid i")
#define EnableInterrrupts()        __asm volatile("cpsie i")

I hope this helps,

Erich

View solution in original post

0 Kudos