Skip to content

Commit fbf4ac0

Browse files
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 wide
1 parent e167992 commit fbf4ac0

File tree

1 file changed

+1
-1
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK

1 file changed

+1
-1
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK/serial_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void serial_baud(serial_t *obj, int baudrate)
9191
void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_bits)
9292
{
9393
LPUART_Type *base = uart_addrs[obj->index];
94-
uint8_t temp;
94+
uint32_t temp;
9595
/* Set bit count and parity mode. */
9696
temp = base->CTRL & ~(LPUART_CTRL_PE_MASK | LPUART_CTRL_PT_MASK | LPUART_CTRL_M_MASK);
9797
if (parity != ParityNone) {

0 commit comments

Comments
 (0)