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.

pull/921/head
Mihail Stoyanov 2015-02-20 02:30:01 +02:00
parent f130a80755
commit 0d4c158505
1 changed files with 7 additions and 0 deletions

View File

@ -37,6 +37,13 @@ class EchoTest():
selftest.mbed.flush()
selftest.notify("HOST: Starting the ECHO test")
result = True
""" This ensures that there are no parasites left in the serial buffer.
"""
for i in range(0, 2):
selftest.mbed.serial_write("\n")
c = selftest.mbed.serial_readline()
for i in range(0, self.TEST_LOOP_COUNT):
TEST_STRING = str(uuid.uuid4()) + "\n"
selftest.mbed.serial_write(TEST_STRING)