JN516x Mutex, Disable / Enable Interrupts

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

JN516x Mutex, Disable / Enable Interrupts

Jump to solution
1,886 Views
erkanermis
Contributor I

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));\

}\

Labels (3)
0 Kudos
1 Solution
1,314 Views
hazeman
Contributor II

This is what I use for disabling interrupts:

/// macro (undocumented but found in NXP headers) to disable interrupts

#define MICRO_DISABLE_INTERRUPTS();                                         \

        asm volatile ("b.di;" : : );

#define MICRO_ENABLE_INTERRUPTS();                                          \

        asm volatile ("b.ei;" : : );

Found this in

C:\Jennic\Components\MicroSpecific\Include\MicroSpecific.h

regards

Liam

View solution in original post

0 Kudos
3 Replies
1,314 Views
erkanermis
Contributor I

Thank you very much

0 Kudos
1,314 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hello!

Thank you for your interest in NXP products.

We are happy to support you through our communities, unfortunately we temporarily have a community structure with two parallel systems which has probably not guided you correctly.

Be ensured we are working on fixing the navigation and the offering as soon as we can.

In the meantime, please re-post your question into the monitored space for this product line:

https://nxpcommunity.force.com/community/CommunityForumQuestionList?category=ZigBee

You may find the following page helpful for navigating to the right spaces:

http://www.nxp.com/support/communities:COMMUNITIES

We apologize for the inconvenience,

The NXP Technical Support Team

0 Kudos
1,315 Views
hazeman
Contributor II

This is what I use for disabling interrupts:

/// macro (undocumented but found in NXP headers) to disable interrupts

#define MICRO_DISABLE_INTERRUPTS();                                         \

        asm volatile ("b.di;" : : );

#define MICRO_ENABLE_INTERRUPTS();                                          \

        asm volatile ("b.ei;" : : );

Found this in

C:\Jennic\Components\MicroSpecific\Include\MicroSpecific.h

regards

Liam

0 Kudos