Skip to content

Commit 0d4c158

Browse files
committed
A minor routine to take care of parasite symbols that may be left over in the serial read buffer. This happens when a program output wasn't terminated with new line. This also does not affect the test results.
1 parent f130a80 commit 0d4c158

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

workspace_tools/host_tests/echo.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ def test(self, selftest):
3737
selftest.mbed.flush()
3838
selftest.notify("HOST: Starting the ECHO test")
3939
result = True
40+
41+
""" This ensures that there are no parasites left in the serial buffer.
42+
"""
43+
for i in range(0, 2):
44+
selftest.mbed.serial_write("\n")
45+
c = selftest.mbed.serial_readline()
46+
4047
for i in range(0, self.TEST_LOOP_COUNT):
4148
TEST_STRING = str(uuid.uuid4()) + "\n"
4249
selftest.mbed.serial_write(TEST_STRING)

0 commit comments

Comments
 (0)