Merge pull request #2038 from infinnovation/parityeven-fix

[K64F] serial_api.c: Fix #1979 assertion error for ParityEven
pull/2094/head
Martin Kojtal 2016-07-04 10:40:06 +01:00 committed by GitHub
commit ebfe44c1bf
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,8 @@ void serial_format(serial_t *obj, int data_bits, SerialParity parity, int stop_b
temp |= (UART_C1_PE_MASK | UART_C1_M_MASK);
if (parity == ParityOdd) {
temp |= UART_C1_PT_MASK;
} else if (parity == ParityEven) {
// PT=0 so nothing more to do
} else {
// Hardware does not support forced parity
MBED_ASSERT(0);