JN516x Mutex, Disable / Enable Interrupts

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

JN516x Mutex, Disable / Enable Interrupts

跳至解决方案
4,620 次查看
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));\

}\

标签 (3)
0 项奖励
回复
1 解答
4,048 次查看
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 项奖励
回复
3 回复数
4,048 次查看
erkanermis
Contributor I

Thank you very much

0 项奖励
回复
4,048 次查看
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 项奖励
回复
4,049 次查看
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 项奖励
回复