![FTDI FT51A Application Note Download Page 137](http://html1.mh-extra.com/html/ftdi/ft51a/ft51a_application-note_2341158137.webp)
Application Note
AN_289 FT51A Programming Guide
Version 1.0
Document Reference No.: FT_000962 Clearance No.: FTDI# 483
136
Copyright © 2015 Future Technology Devices International Limited
// Check what engine interrupted
void INT0_ISR(void) __interrupt (0)
{
uint8_t events = 0;
READ_IO_REG(TOP_INT0, events);
events &= (DMA0_IRQ | DMA1_IRQ | DMA2_IRQ | DMA3_IRQ);
if (events && DMA0_IRQ != NULL)
{
user_callback();
}
// Clear the event flags
WRITE_IO_REG(TOP_INT0, events);
}
It is important to note that while called back, the function must clear the DMA engine-specific
interrupts that triggered the interrupt:
dma_fifo_davail_int
,
dma_fifo_full_int
or
dma_done_int.