Skip to content

Commit c35a6f6

Browse files
committed
Modify serial nc tests init part
During initialization phase of the 2 NC serial tests, there is a character being sent from host to target, based on MBED_HOSTTEST_START. The problem is that the target firmware then creates a "new" serial on the same serial interface. the new or should, or at least may, induce a reset of the IP, so that the character sent by host would be lost. So we're moving the new earlier. the real testing part happens later, to check the next character is not received or sent.
1 parent ff7d7aa commit c35a6f6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libraries/tests/mbed/serial_nc_rx/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
#include "test_env.h"
33

44
int main() {
5+
Serial *pc = new Serial(USBTX, USBRX);
6+
57
MBED_HOSTTEST_TIMEOUT(20);
68
MBED_HOSTTEST_SELECT(serial_nc_rx_auto);
79
MBED_HOSTTEST_DESCRIPTION(Serial NC RX);
810
MBED_HOSTTEST_START("MBED_37");
911

10-
Serial *pc = new Serial(NC, USBRX);
11-
1212
char c = pc->getc();
1313

1414
delete pc;

libraries/tests/mbed/serial_nc_tx/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
#include "test_env.h"
33

44
int main() {
5+
Serial *pc = new Serial(USBTX, USBRX);
6+
57
MBED_HOSTTEST_TIMEOUT(20);
68
MBED_HOSTTEST_SELECT(serial_nc_tx_auto);
79
MBED_HOSTTEST_DESCRIPTION(Serial NC TX);
810
MBED_HOSTTEST_START("MBED_38");
911

1012
// Wait until we receive start signal from host test
11-
Serial *pc = new Serial(USBTX, USBRX);
1213
char c = pc->getc();
1314
delete pc;
1415

0 commit comments

Comments
 (0)