LPC4357 NVIC

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

LPC4357 NVIC

383 次查看
hbxiao168
Contributor I

register AIRCR Interrupt priority group default configuration,

NVIC_SetPriority(TIMER1_IRQn, NVIC_EncodePriority(0,1,0));

NVIC_SetPriority(TIMER0_IRQn, NVIC_EncodePriority(0,2,0));

but I try to use this function  

NVIC_GetPriority(TIMER0_IRQn));//  return  0

NVIC_GetPriority(TIMER1_IRQn);   //  return  0

why ?  

Ths!

0 项奖励
4 回复数

356 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @hbxiao168 

I tested with lpc4337(the same with lpc4357), use below code, it can works well:

Alice_Yang_0-1685429240413.png

 

BR

Alice

 

350 次查看
hbxiao168
Contributor I
Thanks  @Alice_Yang

I will  try,and i want know   __NVIC_PRIO_BITS = ?in you code?

#define __NVIC_PRIO_BITS   7 /*!< Number of Bits used for Priority Levels */
0 项奖励

349 次查看
hbxiao168
Contributor I
how to set the __NVIC_PRIO_BITS?
the register AIRCR Interrupt priority group default configuration, and __NVIC_PRIO_BITS = 7 ?
0 项奖励

340 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @hbxiao168 

You can directly write the Interrupt priority. 

If you want to use "NVIC_EncodePriority()", you need refer to the function code and ARM manual to check how to use it.

 

BR

Alice

0 项奖励