# HG changeset patch # User Paul Boddie # Date 1540314544 -7200 # Node ID 06aa97e33e1e84722475a42d19a982d6bca86b7c # Parent d1226062d91ce5a7e065e1c03fa9f00c9b57ff29 Replaced usage of the DMA interrupt with the Timer3 event for the zero channel. diff -r d1226062d91c -r 06aa97e33e1e examples/vga-timer/main.c --- a/examples/vga-timer/main.c Tue Oct 23 19:01:07 2018 +0200 +++ b/examples/vga-timer/main.c Tue Oct 23 19:09:04 2018 +0200 @@ -102,7 +102,7 @@ | Timer3 -> DMA1: linedata -> PORTB | - DMA1 -> DMA2: zerodata -> PORTB + Timer3 -> DMA2: zerodata -> PORTB */ /* Initiate DMA on the Timer2 interrupt condition, transferring line data to @@ -125,14 +125,13 @@ dma_set_transfer(1, PHYSICAL((uint32_t) screenstart), LINE_LENGTH, HW_PHYSICAL(PORTB), 1, 1); - dma_init_interrupt(1, 0b00001000, 1, 3); /* Enable DMA on the preceding channel's completion, with this also initiating transfers. */ dma_init(2, 3); dma_set_chaining(2, dma_chain_previous); - dma_set_interrupt(2, DMA1, 1); + dma_set_interrupt(2, T3, 1); dma_set_transfer(2, PHYSICAL((uint32_t) zerodata), ZERO_LENGTH, HW_PHYSICAL(PORTB), 1, ZERO_LENGTH); @@ -230,18 +229,7 @@ void visible_active(void) { - uint32_t ifs; - - /* Remove any DMA interrupt condition (CHBCIF). */ - - ifs = REG(DMAIFS) & DMA_INT_FLAGS(1, DCHxIF); - - if (ifs) - { - CLR_REG(DMA_REG(1, DCHxINT), 0b11111111); - CLR_REG(DMAIFS, ifs); - INV_REG(PORTA, 1 << 2); - } + INV_REG(PORTA, 1 << 2); if (line < VFP_START) {