Skip to content

Commit a28b361

Browse files
committed
Merge pull request #921 from screamerbg/master
Tools - Output extension handling and echo test improvement
2 parents d39e42d + 0d4c158 commit a28b361

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
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)

workspace_tools/targets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def __init__(self):
415415
self.detect_code = ["0230"]
416416

417417
class TEENSY3_1(Target):
418-
OUTPUT_EXT = '.hex'
418+
OUTPUT_EXT = 'hex'
419419

420420
def __init__(self):
421421
Target.__init__(self)
@@ -742,7 +742,7 @@ class NRF51822(Target):
742742
'offset' : 0x14000
743743
}
744744
]
745-
OUTPUT_EXT = '.hex'
745+
OUTPUT_EXT = 'hex'
746746
MERGE_SOFT_DEVICE = True
747747

748748
def __init__(self):

workspace_tools/toolchains/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,8 @@ def build_library(self, objects, dir, name):
633633

634634
def link_program(self, r, tmp_path, name):
635635
ext = 'bin'
636+
if hasattr(self.target, 'OUTPUT_EXT'):
637+
ext = self.target.OUTPUT_EXT
636638

637639
if hasattr(self.target, 'OUTPUT_NAMING'):
638640
self.var("binary_naming", self.target.OUTPUT_NAMING)
@@ -641,7 +643,6 @@ def link_program(self, r, tmp_path, name):
641643
ext = ext[0:3]
642644

643645
filename = name+'.'+ext
644-
645646
elf = join(tmp_path, name + '.elf')
646647
bin = join(tmp_path, filename)
647648

@@ -657,9 +658,6 @@ def link_program(self, r, tmp_path, name):
657658
self.var("compile_succeded", True)
658659
self.var("binary", filename)
659660

660-
if hasattr(self.target, 'OUTPUT_EXT'):
661-
bin = bin.replace('.bin', self.target.OUTPUT_EXT)
662-
663661
return bin
664662

665663
def default_cmd(self, command):

0 commit comments

Comments
 (0)