From 3de6447315ac75f0d7af9b34d90909480d9e4d5d Mon Sep 17 00:00:00 2001 From: Desuuuu Date: Tue, 6 Apr 2021 01:05:23 +0200 Subject: [PATCH] fix UART baudrate on LPC176X --- src/lpc176x/serial_t5uid1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lpc176x/serial_t5uid1.c b/src/lpc176x/serial_t5uid1.c index 4b43b07e..7ac0fe08 100644 --- a/src/lpc176x/serial_t5uid1.c +++ b/src/lpc176x/serial_t5uid1.c @@ -89,7 +89,7 @@ t5uid1_init(uint32_t baud) // Setup baud LPC_UARTx->LCR = (1<<7); // set DLAB bit enable_pclock(PCLK_UARTx); - uint32_t pclk = SystemCoreClock; + uint32_t pclk = get_pclock_frequency(PCLK_UARTx); uint32_t div = pclk / (baud * 16); LPC_UARTx->DLL = div & 0xff; LPC_UARTx->DLM = (div >> 8) & 0xff;