AnsweredAssumed Answered

JN516x Mutex, Disable / Enable Interrupts

Question asked by Erkan Ermiş on Jan 22, 2016
Latest reply on Jan 26, 2016 by Erkan Ermiş

Hello,

 

I was using following mutex code in JN5148 in order to disable/enable interrupts. What is the JN516x equivalent of following code?

I am using Eclipse IDE and 802.15.4 stack.

 

Thanks for your help.

 

 

#define ENABLE_INTERRUPTS();\
{\
  register uint32 ru32CtrlReg;\
  asm volatile ("l.mfspr %0, r0, 17;" :"=r"(ru32CtrlReg) : );\
  ru32CtrlReg |= 6;\
    asm volatile ("l.mtspr r0, %0, 17;" : :"r"(ru32CtrlReg));\
}\

#define DISABLE_INTERRUPTS();\
{\
  register uint32 ru32CtrlReg;\
  asm volatile ("l.mfspr %0, r0, 17;" :"=r"(ru32CtrlReg) : );\
  ru32CtrlReg &= 0xfffffff9;\
  asm volatile ("l.mtspr r0, %0, 17;" : :"r"(ru32CtrlReg));\
}\

Outcomes