DMA陷入死循环我的DMA程序也陷入死循环,请您知道一下! #define TRANSFER_LENGTH 3367; static volatile int dma_complete = 0; void dma_done (void* handle){ dma_complete = 1; } int main(void) { int rc; alt_dma_txchan txchan; alt_u8* tx_data = nararray0[0];
/*Create the transmit channel*/
if((txchan = alt_dma_txchan_open("/dev/dma")) == NULL) { printf ("Failed to open transmit channel\n"); exit(1); } else { printf ("Create the transmit channel successfully!\n"); }
//post the transmit request if((rc = alt_dma_txchan_send(txchan, tx_data, TRANSFER_LENGTH, done, NULL)) < 0) { printf ("Failed to post transmit request, reason = %i\n", return_code); exit (1); } else { printf ("Post the transmit request successfully!\n"); } while(!dma_complete); printf("Transfer sucessful!\n"); return 0; }
它一直执行while(!dma_complete);陷入死循环,希望高手能够指点一下!! |