From c8d3552e70cac387a984641586cc9fd034741c09 Mon Sep 17 00:00:00 2001 From: Woo Date: Mon, 13 May 2024 17:54:09 -0500 Subject: [PATCH] Revert MXC_DMA_INSTANCES to TARGET_NUM checks --- .../PeriphDrivers/Source/UART/uart_revb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/UART/uart_revb.c b/Libraries/PeriphDrivers/Source/UART/uart_revb.c index 1888f35a9d..5e2067ebf1 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_revb.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_revb.c @@ -828,7 +828,7 @@ int MXC_UART_RevB_SetAutoDMAHandlers(mxc_uart_revb_regs_t *uart, bool enable) return E_NO_ERROR; } -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) void MXC_UART_RevA_DMA0_Handler(void) { @@ -848,7 +848,7 @@ DMA instance. void MXC_UART_RevB_DMA_SetupAutoHandlers(mxc_dma_regs_t *dma_instance, unsigned int channel) { #ifdef __arm__ -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) NVIC_EnableIRQ(MXC_DMA_CH_GET_IRQ(dma_instance, channel)); /* (JC): This is not the cleanest or most scalable way to do this, @@ -920,7 +920,7 @@ int MXC_UART_RevB_ReadRXFIFODMA(mxc_uart_revb_regs_t *uart, mxc_dma_regs_t *dma, if (states[uart_num].auto_dma_handlers && states[uart_num].channelRx < 0) { /* Acquire channel if we don't have one already */ -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) channel = MXC_DMA_AcquireChannel(dma); #else channel = MXC_DMA_AcquireChannel(); @@ -949,7 +949,7 @@ int MXC_UART_RevB_ReadRXFIFODMA(mxc_uart_revb_regs_t *uart, mxc_dma_regs_t *dma, MXC_DMA_ConfigChannel(config, srcdst); MXC_DMA_SetCallback(channel, MXC_UART_DMACallback); -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) MXC_DMA_EnableInt(dma, channel); #else MXC_DMA_EnableInt(channel); @@ -978,7 +978,7 @@ int MXC_UART_RevB_WriteTXFIFODMA(mxc_uart_revb_regs_t *uart, mxc_dma_regs_t *dma if (states[uart_num].auto_dma_handlers && states[uart_num].channelTx < 0) { /* Acquire channel if we don't have one already */ -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) channel = MXC_DMA_AcquireChannel(dma); #else channel = MXC_DMA_AcquireChannel(); @@ -1007,7 +1007,7 @@ int MXC_UART_RevB_WriteTXFIFODMA(mxc_uart_revb_regs_t *uart, mxc_dma_regs_t *dma MXC_DMA_ConfigChannel(config, srcdst); MXC_DMA_SetCallback(channel, MXC_UART_DMACallback); -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) MXC_DMA_EnableInt(dma, channel); #else MXC_DMA_EnableInt(channel); @@ -1052,7 +1052,7 @@ int MXC_UART_RevB_TransactionDMA(mxc_uart_revb_req_t *req, mxc_dma_regs_t *dma) (req->uart)->dma |= (1 << MXC_F_UART_REVB_DMA_RX_THD_VAL_POS); (req->uart)->dma |= (2 << MXC_F_UART_REVB_DMA_TX_THD_VAL_POS); -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) MXC_DMA_Init(dma); #else MXC_DMA_Init(); @@ -1066,7 +1066,7 @@ int MXC_UART_RevB_TransactionDMA(mxc_uart_revb_req_t *req, mxc_dma_regs_t *dma) if ((req->txData != NULL) && (req->txLen)) { /* Save TX req, the DMA handler will use this later. */ states[uart_num].tx_req = req; -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) if (MXC_UART_WriteTXFIFODMA((mxc_uart_regs_t *)(req->uart), dma, req->txData, req->txLen, NULL) != E_NO_ERROR) { #else @@ -1080,7 +1080,7 @@ int MXC_UART_RevB_TransactionDMA(mxc_uart_revb_req_t *req, mxc_dma_regs_t *dma) //rx if ((req->rxData != NULL) && (req->rxLen)) { states[uart_num].rx_req = req; -#if (MXC_DMA_INSTANCES > 1) +#if (TARGET_NUM == 32657) if (MXC_UART_ReadRXFIFODMA((mxc_uart_regs_t *)(req->uart), dma, req->rxData, req->rxLen, NULL) != E_NO_ERROR) { #else