diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/serial_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/serial_api.c index 0af83e98d30..78debf71f87 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/serial_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/serial_api.c @@ -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) { diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK/serial_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK/serial_api.c index c479ade934e..e02ca5d7655 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK/serial_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1170/TARGET_EVK/serial_api.c @@ -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) {