2 IRQ on PORTC

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

2 IRQ on PORTC

883 次查看
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 项奖励
回复
2 回复数

780 次查看
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 项奖励
回复

780 次查看
haroldvogel
Contributor II

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

0 项奖励
回复