2 IRQ on PORTC

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

2 IRQ on PORTC

733 Views
haroldvogel
Contributor II

I am working with the TWR-K22F120M Development board.  I have looked at some of the Demo code but cannot find out how to do what I wish to do.  I would like to have an interrupt occur if Switch 1 or Switch 3 is pushed and I would like to know which switch was pressed.  I tried to duplicate the interrupt code fhat is used to interrupt when switch 3 is pushed but I receive and error that PORTC is redefined.

So how do I write code to have an interrupt trigger if either switch 1 or switch 3 is pushed and to know which switch was pressed.

0 Kudos
2 Replies

630 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Harold,

You can use a gpio in PORTA group as swith1, and use a gpio in PORTC group as swith3. They are different isr source.

OS will not affect your interrupt function. All the unused interrupt address in the vector table is announced as [weak]. Which means if you announced you own interrupt service function, the default interrupt address is ignored. So if you received an error that the PORTC is redefined, I think this may cause by improper code or multi defined code.

Regards

Jing

0 Kudos

630 Views
haroldvogel
Contributor II

I forgot to add that I am using FreeRTOS on the board.

0 Kudos