From 70fc3380ab3872251e6c41b0138d4beaf8cbfda8 Mon Sep 17 00:00:00 2001 From: Sadik Ozer Date: Fri, 13 Sep 2024 12:23:49 +0300 Subject: [PATCH] chore(Other, PeriphDrivers): Fix MAX32xxx UART build issue Final changes break zephyr build, this commit fix them for UART Signed-off-by: Sadik Ozer --- Libraries/PeriphDrivers/Source/UART/uart_me12.c | 2 +- Libraries/PeriphDrivers/Source/UART/uart_me15.c | 2 +- Libraries/PeriphDrivers/Source/UART/uart_me16.c | 3 ++- Libraries/PeriphDrivers/Source/UART/uart_me17.c | 2 +- Libraries/PeriphDrivers/Source/UART/uart_me18.c | 4 ++-- Libraries/PeriphDrivers/Source/UART/uart_me21.c | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me12.c b/Libraries/PeriphDrivers/Source/UART/uart_me12.c index c685f50fd6..e975f48b30 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me12.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me12.c @@ -43,9 +43,9 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock, sys_map_t map) { -#ifndef MSDK_NO_GPIO_CLK_INIT int retval; +#ifndef MSDK_NO_GPIO_CLK_INIT retval = MXC_UART_Shutdown(uart); if (retval) { return retval; diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me15.c b/Libraries/PeriphDrivers/Source/UART/uart_me15.c index 1d322784af..e9fea7d442 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me15.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me15.c @@ -45,9 +45,9 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock) { -#ifndef MSDK_NO_GPIO_CLK_INIT int retval; +#ifndef MSDK_NO_GPIO_CLK_INIT retval = MXC_UART_Shutdown(uart); if (retval) { diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me16.c b/Libraries/PeriphDrivers/Source/UART/uart_me16.c index b2fda9f9b1..83dc27e9a4 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me16.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me16.c @@ -48,8 +48,9 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock) { + int retval; #ifndef MSDK_NO_GPIO_CLK_INIT - int retval, error; + int error; retval = MXC_UART_Shutdown(uart); if (retval) { diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me17.c b/Libraries/PeriphDrivers/Source/UART/uart_me17.c index 9ba0921763..dd494ab2dc 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me17.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me17.c @@ -44,9 +44,9 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock) { -#ifndef MSDK_NO_GPIO_CLK_INIT int retval; +#ifndef MSDK_NO_GPIO_CLK_INIT retval = MXC_UART_Shutdown(uart); if (retval) { return retval; diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me18.c b/Libraries/PeriphDrivers/Source/UART/uart_me18.c index 7e43aa60d7..692df7fe44 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me18.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me18.c @@ -44,7 +44,6 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock) { -#ifndef MSDK_NO_GPIO_CLK_INIT int retval; if (!MXC_UART_RevB_IsClockSourceLocked((mxc_uart_revb_regs_t *)uart)) { @@ -54,6 +53,7 @@ int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clo } } +#ifndef MSDK_NO_GPIO_CLK_INIT switch (MXC_UART_GET_IDX(uart)) { case 0: MXC_GPIO_Config(&gpio_cfg_uart0); @@ -78,11 +78,11 @@ int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clo default: return E_BAD_PARAM; } +#endif retval = MXC_UART_SetClockSource(uart, clock); if (retval) return retval; -#endif return MXC_UART_RevB_Init((mxc_uart_revb_regs_t *)uart, baud, MXC_UART_GetClockSource(uart)); } diff --git a/Libraries/PeriphDrivers/Source/UART/uart_me21.c b/Libraries/PeriphDrivers/Source/UART/uart_me21.c index 47b5246612..86cdafe5af 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_me21.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_me21.c @@ -69,8 +69,8 @@ int MXC_UART_AsyncStop(mxc_uart_regs_t *uart) int MXC_UART_Init(mxc_uart_regs_t *uart, unsigned int baud, mxc_uart_clock_t clock) { -#ifndef MSDK_NO_GPIO_CLK_INIT int retval; +#ifndef MSDK_NO_GPIO_CLK_INIT sys_map_t current_pin_mapping = MXC_UART_GetPinMapping(uart); retval = MXC_UART_Shutdown(uart);