- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I can't seem to find clear documentation regarding setup of GPIO interrupts and setting the callbacks. For example, I see the edge type is set up in the GUI on the schematic, but then in the example program CE220263 there is redundant code to do the same thing.
Thanks in advance,
Scott
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well... I think the CE220263 is a perfect example of us getting out of control making a huge code example for a simple idea.
The code example was setup to show both a "pure pdf" and an old style creator implementation of a pin interrupt.
But to your answer.
The last line in the ISR (and the file) clears the interrupt source in the port interrupt.
Cy_GPIO_ClearInterrupt(SW2_P0_4_PORT, SW2_P0_4_NUM);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well... I think the CE220263 is a perfect example of us getting out of control making a huge code example for a simple idea.
The code example was setup to show both a "pure pdf" and an old style creator implementation of a pin interrupt.
But to your answer.
The last line in the ISR (and the file) clears the interrupt source in the port interrupt.
Cy_GPIO_ClearInterrupt(SW2_P0_4_PORT, SW2_P0_4_NUM);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your prompt answer..
So besides calling the function you mentioned in the ISR callback to clear the interrupt, do I also need to make a call to
NVIC_ClearPendingIRQ
or is this handled in the call to Gy_GPIO_ClearInterrupt?
Thanks again,
Scott
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The specific answer to your question is. No. You dont need to clear the interrupt.
But it was not "Or is this handled..." because ARM Interrupts are cleared when you service them.
Obviously they immediately re-pend if you dont clear the source...
Alan