Skip to content

Commit bc29292

Browse files
committed
FPGA UART test: disable 7 bits test for K64F
1 parent 0f66046 commit bc29292

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

TESTS/configs/fpga.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"K64F": {
1515
"target.macros_add": [
16-
"UART_7BITS_PARITY_NONE_NOT_SUPPORTED",
16+
"UART_7BITS_NOT_SUPPORTED",
1717
"UART_9BITS_NOT_SUPPORTED"
1818
]
1919
},

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,10 @@ static void test_irq_handler(uint32_t id, SerialIrq event)
8686
static void uart_test_common(int baudrate, int data_bits, SerialParity parity, int stop_bits, bool init_direct, PinName tx, PinName rx, PinName cts, PinName rts)
8787
{
8888
// The FPGA CI shield only supports None, Odd & Even.
89-
// Forced parity is not supported on Atmel, Freescale, Nordic & STM targets.
89+
// Forced parity is not supported on many targets
9090
MBED_ASSERT(parity != ParityForced1 && parity != ParityForced0);
9191

92-
// STM-specific constraints
93-
// Only 7, 8 & 9 data bits.
94-
MBED_ASSERT(data_bits >= 7 && data_bits <= 9);
95-
92+
// See TESTS/configs/fpga.json to check which target supports what
9693
#if defined(UART_9BITS_NOT_SUPPORTED)
9794
if (data_bits == 9) {
9895
utest_printf(" UART_9BITS_NOT_SUPPORTED set ... ");
@@ -107,6 +104,13 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i
107104
}
108105
#endif
109106

107+
#if defined(UART_7BITS_NOT_SUPPORTED)
108+
if (data_bits == 7) {
109+
utest_printf(" UART_7BITS_NOT_SUPPORTED set ... ");
110+
return;
111+
}
112+
#endif
113+
110114
#if defined(UART_7BITS_PARITY_NONE_NOT_SUPPORTED)
111115
if ((data_bits == 7) && (parity == ParityNone)) {
112116
utest_printf(" UART_7BITS_PARITY_NONE_NOT_SUPPORTED set ... ");

0 commit comments

Comments
 (0)