Skip to content

Commit

Permalink
chore(Other, PeriphDrivers): Fix MAX32xxx UART build issue
Browse files Browse the repository at this point in the history
Final changes break zephyr build, this commit fix them for UART

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
  • Loading branch information
ozersa committed Sep 13, 2024
1 parent 74a08bd commit 59fd279
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Libraries/PeriphDrivers/Source/UART/uart_me12.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Libraries/PeriphDrivers/Source/UART/uart_me15.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion Libraries/PeriphDrivers/Source/UART/uart_me16.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion Libraries/PeriphDrivers/Source/UART/uart_me17.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Libraries/PeriphDrivers/Source/UART/uart_me18.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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);
Expand All @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion Libraries/PeriphDrivers/Source/UART/uart_me21.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 59fd279

Please sign in to comment.