#include "hard_hdma_int.h" #include "hpm_dma_drv.h" #include "board.h" volatile bool uart1_tx_dma_done = true; volatile bool uart2_tx_dma_done = true; volatile bool uart3_tx_dma_done = true; volatile bool uart4_tx_dma_done = true; volatile bool uart5_tx_dma_done = true; volatile bool uart6_tx_dma_done = true; extern struct _uart_config _u1_config; extern struct _uart_config _u4_config; extern void uart_tx_dma_isr_callback(struct _uart_config *config); /*--------------------------------------------------------------------------*/ /* DMA 发送完成中断服务程序 */ /*--------------------------------------------------------------------------*/ SDK_DECLARE_EXT_ISR_M(IRQn_HDMA, dma_isr) void dma_isr(void) { //volatile hpm_stat_t stat_tx_chn; //stat_tx_chn = dma_check_transfer_status(SBUS_UART2_DMA_CONTROLLER, SBUS_UART2_TX_DMA_CH); //if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) { // uart2_tx_dma_done = true; //} //stat_tx_chn = dma_check_transfer_status(IMU_UART3_DMA_CONTROLLER, IMU_UART3_TX_DMA_CH); //if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) { // uart3_tx_dma_done = true; // uart_tx_dma_isr_callback(&_u3_config); // 串口3 DMA发送中断回调 //} volatile hpm_stat_t stat_tx_chn = dma_check_transfer_status(HPM_HDMA, 0); if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) { uart1_tx_dma_done = true; uart_tx_dma_isr_callback(&_u1_config); } if (stat_tx_chn & DMA_CHANNEL_STATUS_TC) { uart4_tx_dma_done = true; uart_tx_dma_isr_callback(&_u4_config); } }