How can I mask all Interrupts on MK21FN1M0VMC12

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How can I mask all Interrupts on MK21FN1M0VMC12

跳至解决方案
845 次查看
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?

标签 (2)
0 项奖励
1 解答
654 次查看
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 项奖励
1 回复
655 次查看
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 项奖励