How can I mask all Interrupts on MK21FN1M0VMC12

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I mask all Interrupts on MK21FN1M0VMC12

Jump to solution
821 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
630 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
631 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

0 Kudos