Skip to content

Commit c19dd19

Browse files
authored
Merge pull request #2723 from NXPmicro/Update_Serial_API
KSDK serial_api.c: Fix assertion error for ParityEven
2 parents 663fdb7 + 20fc6ce commit c19dd19

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K22F/serial_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
9898
temp |= (UART_C1_PE_MASK | UART_C1_M_MASK);
9999
if (parity == ParityOdd) {
100100
temp |= UART_C1_PT_MASK;
101+
} else if (parity == ParityEven) {
102+
// PT=0 so nothing more to do
101103
} else {
102104
// Hardware does not support forced parity
103105
MBED_ASSERT(0);

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL27Z/serial_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
103103
temp |= (LPUART_CTRL_PE_MASK | LPUART_CTRL_M_MASK);
104104
if (parity == ParityOdd) {
105105
temp |= LPUART_CTRL_PT_MASK;
106+
} else if (parity == ParityEven) {
107+
// PT=0 so nothing more to do
106108
} else {
107109
// Hardware does not support forced parity
108110
MBED_ASSERT(0);

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_KL43Z/serial_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
103103
temp |= (LPUART_CTRL_PE_MASK | LPUART_CTRL_M_MASK);
104104
if (parity == ParityOdd) {
105105
temp |= LPUART_CTRL_PT_MASK;
106+
} else if (parity == ParityEven) {
107+
// PT=0 so nothing more to do
106108
} else {
107109
// Hardware does not support forced parity
108110
MBED_ASSERT(0);

0 commit comments

Comments
 (0)