interrupt priority

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

interrupt priority

1,283 Views
giacomopetrini
Contributor IV

I'm using KDS 1.1.1 and KSDK 1.0.0. All updated.

I'm creating a project using Processor Expert, but I can't find any placeto change interrupt priority.

It' quite important because I need to read a I2C device in a isr (from the PIT) but by default the PIT-isr  and the I2C isr (that is used to send/receive bytes) have the same priority, so the I2C-isr is never called when the program is inside the PIT-isr.

 

So: there is a way to change the interrutp priority?

 

Thank Bye

Giacomo

Labels (1)
2 Replies

613 Views
martynhunt
NXP Employee
NXP Employee

The KSDK comes bundled with the CMSIS core functions. You can use the 'NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)' function to set the priority of each interrupt. For example:

NVIC_SetPriority(PIT0_IRQn, 1);

NVIC_SetPriority(I2C0_IRQn, 0);

Please let me know if you have any trouble implementing the interrupt priorities this way.

Thank you,

Martyn

613 Views
giacomopetrini
Contributor IV

Thanks.

After posting I figured it out. Too bad it can't be done automatically in PE...

Bye Giacomo

0 Kudos