diff --git a/Examples/MAX78000/UART/main.c b/Examples/MAX78000/UART/main.c index 1250a042d0..b46e4a4628 100644 --- a/Examples/MAX78000/UART/main.c +++ b/Examples/MAX78000/UART/main.c @@ -102,8 +102,13 @@ int main(void) printf("-->Example Failed\n"); return error; } - +#if defined(BOARD_EVKIT_V1) if ((error = MXC_UART_Init(WRITING_UART, UART_BAUD, MXC_UART_APB_CLK)) != E_NO_ERROR) { +#elif defined(BOARD_FTHR_REVA) + // We define UART3(LPUART) as WRITING_UART for FTHR Board. + // LPUART can use IBRO and ERTCO clocks. + if ((error = MXC_UART_Init(WRITING_UART, UART_BAUD, MXC_UART_IBRO_CLK)) != E_NO_ERROR) { +#endif printf("-->Error initializing UART: %d\n", error); printf("-->Example Failed\n"); return error; diff --git a/Libraries/PeriphDrivers/Source/UART/uart_ai85.c b/Libraries/PeriphDrivers/Source/UART/uart_ai85.c index 11ca956784..ead00fc63b 100644 --- a/Libraries/PeriphDrivers/Source/UART/uart_ai85.c +++ b/Libraries/PeriphDrivers/Source/UART/uart_ai85.c @@ -273,14 +273,14 @@ int MXC_UART_SetClockSource(mxc_uart_regs_t *uart, mxc_uart_clock_t clock) #ifndef MSDK_NO_GPIO_CLK_INIT retval = MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_IBRO); #endif // MSDK_NO_GPIO_CLK_INIT - clock_option = 2; + clock_option = 0; break; case MXC_UART_ERTCO_CLK: #ifndef MSDK_NO_GPIO_CLK_INIT retval = MXC_SYS_ClockSourceEnable(MXC_SYS_CLOCK_ERTCO); #endif // MSDK_NO_GPIO_CLK_INIT - clock_option = 3; + clock_option = 1; break; default: @@ -316,9 +316,9 @@ mxc_uart_clock_t MXC_UART_GetClockSource(mxc_uart_regs_t *uart) break; case 3: switch (clock_option) { - case 2: + case 0: return MXC_UART_IBRO_CLK; - case 3: + case 1: return MXC_UART_ERTCO_CLK; default: return E_BAD_STATE;