Skip to content

Commit 982e52e

Browse files
illustriousnessRbb666
authored andcommitted
[bsp/nxp/mcx/mcxa] Fix UART clock configuration type mismatch
Fixed implicit type conversion warning in UART driver by correctly separating clock_name_t and clock_attach_id_t enum types. Changes: - Use kCLOCK_Fro12M (clock_name_t) for clock_src field - Keep kFRO12M_to_LPUARTx (clock_attach_id_t) for clock_attach_id field - Fix mcx_getc() to use correct status flag kLPUART_RxDataRegFullFlag This resolves the compiler warning: "implicit conversion from 'int' to 'clock_name_t' changes value from 16777216 to 0" Signed-off-by: Yucai Liu [email protected]
1 parent d3e0a53 commit 982e52e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bsp/nxp/mcx/mcxa/Libraries/drivers/drv_uart.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ static const struct mcx_uart uarts[] =
6464
&serial0,
6565
LPUART0,
6666
LPUART0_IRQn,
67+
kCLOCK_Fro12M,
6768
#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN))
6869
kFRO_LF_DIV_to_LPUART0,
6970
#else
7071
kFRO12M_to_LPUART0,
7172
#endif
72-
kFRO12M_to_LPUART0,
7373
kCLOCK_GateLPUART0,
7474
kCLOCK_DivLPUART0,
7575
"uart0",
@@ -80,12 +80,12 @@ static const struct mcx_uart uarts[] =
8080
&serial1,
8181
LPUART1,
8282
LPUART1_IRQn,
83+
kCLOCK_Fro12M,
8384
#if (defined(CPU_MCXA346VLH) || defined(CPU_MCXA346VLL) || defined(CPU_MCXA346VLQ) || defined(CPU_MCXA346VPN))
8485
kFRO_LF_DIV_to_LPUART1,
8586
#else
8687
kFRO12M_to_LPUART1,
8788
#endif
88-
kFRO12M_to_LPUART1,
8989
kCLOCK_GateLPUART1,
9090
kCLOCK_DivLPUART1,
9191
"uart1",
@@ -182,7 +182,7 @@ static int mcx_getc(struct rt_serial_device *serial)
182182
{
183183
struct mcx_uart *uart = (struct mcx_uart *)serial->parent.user_data;
184184

185-
if (kLPUART_RxDataRegFullInterruptEnable & LPUART_GetStatusFlags(uart->uart_base))
185+
if (kLPUART_RxDataRegFullFlag & LPUART_GetStatusFlags(uart->uart_base))
186186
{
187187
return LPUART_ReadByte(uart->uart_base);
188188
}

0 commit comments

Comments
 (0)