From e2a9134cf7105af363d44f3fb1715ccf6e951a00 Mon Sep 17 00:00:00 2001 From: Jake Carter Date: Tue, 10 Oct 2023 17:41:20 -0500 Subject: [PATCH] clang-format --- .../Device/Maxim/MAX32665/Include/max32665.h | 5 +++-- .../PeriphDrivers/Source/UART/uart_reva.c | 18 +++++++++--------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h b/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h index d236343d3e..91c533f248 100644 --- a/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h +++ b/Libraries/CMSIS/Device/Maxim/MAX32665/Include/max32665.h @@ -499,8 +499,9 @@ typedef enum { ((i) == 7) ? DMA15_IRQn : \ 0)) -#define MXC_DMA_CH_GET_IRQ(i) \ - (((i) > (MXC_DMA_CH_OFFSET - 1)) ? MXC_DMA1_CH_GET_IRQ(i % MXC_DMA_CH_OFFSET) : MXC_DMA0_CH_GET_IRQ(i)) +#define MXC_DMA_CH_GET_IRQ(i) \ + (((i) > (MXC_DMA_CH_OFFSET - 1)) ? MXC_DMA1_CH_GET_IRQ(i % MXC_DMA_CH_OFFSET) : \ + MXC_DMA0_CH_GET_IRQ(i)) /* Create alias for MXC_DMA0 for backwards compatibility with code that was written for parts that only had one DMA instance. */ diff --git a/Libraries/PeriphDrivers/Source/UART/uart_reva.c b/Libraries/PeriphDrivers/Source/UART/uart_reva.c index ba9ccb05c6..e4777d6bc4 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_reva.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_reva.c @@ -598,7 +598,7 @@ void MXC_UART_RevA_DMA_SetupAutoHandlers(mxc_dma_regs_t *dma_instance, unsigned #endif // MXC_DMA_INSTANCES > 1 #else -// TODO(JC): RISC-V + // TODO(JC): RISC-V #endif // __arm__ } @@ -620,7 +620,7 @@ int MXC_UART_RevA_ReadRXFIFODMA(mxc_uart_reva_regs_t *uart, mxc_dma_regs_t *dma, return E_NULL_PTR; } - if (states[uart_num].auto_dma_handlers) { + if (states[uart_num].auto_dma_handlers) { /* Acquire channel */ #if TARGET_NUM == 32665 channel = MXC_DMA_AcquireChannel(dma); @@ -649,7 +649,7 @@ int MXC_UART_RevA_ReadRXFIFODMA(mxc_uart_reva_regs_t *uart, mxc_dma_regs_t *dma, srcdst.ch = channel; srcdst.dest = bytes; - srcdst.len = len; + srcdst.len = len; MXC_DMA_ConfigChannel(config, srcdst); MXC_DMA_SetCallback(channel, MXC_UART_DMACallback); @@ -700,7 +700,7 @@ int MXC_UART_RevA_SetTXDMAChannel(mxc_uart_reva_regs_t *uart, unsigned int chann int n = MXC_UART_GET_IDX((mxc_uart_regs_t *)uart); if (n < 0) return E_BAD_PARAM; - + states[n].channelTx = channel; return E_NO_ERROR; @@ -711,7 +711,7 @@ int MXC_UART_RevA_GetTXDMAChannel(mxc_uart_reva_regs_t *uart) int n = MXC_UART_GET_IDX((mxc_uart_regs_t *)uart); if (n < 0) return E_BAD_PARAM; - + return states[n].channelTx; } @@ -720,7 +720,7 @@ int MXC_UART_RevA_SetRXDMAChannel(mxc_uart_reva_regs_t *uart, unsigned int chann int n = MXC_UART_GET_IDX((mxc_uart_regs_t *)uart); if (n < 0) return E_BAD_PARAM; - + states[n].channelRx = channel; return E_NO_ERROR; @@ -731,7 +731,7 @@ int MXC_UART_RevA_GetRXDMAChannel(mxc_uart_reva_regs_t *uart) int n = MXC_UART_GET_IDX((mxc_uart_regs_t *)uart); if (n < 0) return E_BAD_PARAM; - + return states[n].channelRx; } @@ -1139,8 +1139,8 @@ void MXC_UART_RevA_DMACallback(int ch, int error) if (ch == states[i].channelRx) states[i].channelRx = -1; else - states[i].channelTx = -1; - } + states[i].channelTx = -1; + } break; }