mirror of https://github.com/ARMmbed/mbed-os.git
Change temp to uint32_t in serial_format
Fix bug where calling set_format in MBED (which calls serial_format) causes the CTRL register to become corrupt due to saving its initial value to a uint8_t when the register is 32 bit widepull/15382/head
parent
5c8e60f80b
commit
e167992769
|
@ -91,7 +91,7 @@ void serial_baud(serial_t *obj, int baudrate)
|
|||
void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits)
|
||||
{
|
||||
LPUART_Type *base = uart_addrs[obj->index];
|
||||
uint8_t temp;
|
||||
uint32_t temp;
|
||||
/* Set bit count and parity mode. */
|
||||
temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK);
|
||||
if (parity != ParityNone) {
|
||||
|
|
Loading…
Reference in New Issue