Skip to content

Conversation

@eamars
Copy link
Contributor

@eamars eamars commented Apr 21, 2017

Hello Michael, I find some people didn't use PIO based interrupt handler for sam4s correctly. The PIO interrupt example shows that pio_handler() is one of the generic handler, which is called when any of interrupt occurs at PORT_A. People may not realize that pio_handler() is shared across all PORT_A peripherals.

Furthermore, for those who didn't realize how "Dynamic Vector Table" works, would like to add an additional interrupt source at PORT_A, will possibly go wrong by replacing current interrupt handler with the new one. As a result, multiple interrupt sources would trigger the same interrupt whereas they aren't suppose to do so.

To make it clear, I introduced pio_irq_init(), which would register PIO based interrupt handler, is called when corresponding PIO interrupt is generated. Internally, pio_irq_common_handler will find out which PIO generates interrupt based on the information in PIO_IMR and PIO_ISR, according to datasheet.

However I don't have wacky racer board to test with. I have also included an example showing how to use PIO interrupt correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants