LPC4357 NVIC

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

LPC4357 NVIC

366 Views
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 Kudos
4 Replies

339 Views
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

 

333 Views
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 Kudos

332 Views
hbxiao168
Contributor I
how to set the __NVIC_PRIO_BITS?
the register AIRCR Interrupt priority group default configuration, and __NVIC_PRIO_BITS = 7 ?
0 Kudos

323 Views
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 Kudos