mirror of https://github.com/ARMmbed/mbed-os.git
Update serial_api.c
Fixed the incorrect clocksource for the baud generator. Should be MainClock instead of SystemCoreClock. This also allows the correct use of the PLL for MainClock and SystemCoreClock without breaking the serial baudrate.pull/870/head
parent
6fefefa3bb
commit
fd82a674ab
|
@ -117,9 +117,10 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) {
|
|||
/* Peripheral reset control to UART, a "1" bring it out of reset. */
|
||||
LPC_SYSCON->PRESETCTRL &= ~(0x1 << (3 + uart_n));
|
||||
LPC_SYSCON->PRESETCTRL |= (0x1 << (3 + uart_n));
|
||||
|
||||
UARTSysClk = SystemCoreClock / LPC_SYSCON->UARTCLKDIV;
|
||||
|
||||
|
||||
//WH
|
||||
UARTSysClk = MainClock / LPC_SYSCON->UARTCLKDIV;
|
||||
|
||||
// set default baud rate and format
|
||||
serial_baud (obj, 9600);
|
||||
serial_format(obj, 8, ParityNone, 1);
|
||||
|
|
Loading…
Reference in New Issue