LPC4357 NVIC

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC4357 NVIC

384件の閲覧回数
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 返答(返信)

357件の閲覧回数
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

 

351件の閲覧回数
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 件の賞賛

350件の閲覧回数
hbxiao168
Contributor I
how to set the __NVIC_PRIO_BITS?
the register AIRCR Interrupt priority group default configuration, and __NVIC_PRIO_BITS = 7 ?
0 件の賞賛

341件の閲覧回数
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 件の賞賛