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.
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
I forgot to add that I am using FreeRTOS on the board.