Skip to content

Commit c241af3

Browse files
committed
Keep information about type of interface disk provided by the target board
1 parent 003c48c commit c241af3

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

workspace_tools/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def args_error(parser, message):
104104
# Import pyserial: https://pypi.python.org/pypi/pyserial
105105
from serial import Serial
106106

107-
sleep(target.program_cycle_s)
107+
sleep(target.program_cycle_s())
108108
serial = Serial(options.serial, timeout = 1)
109109
if options.baud:
110110
serial.setBaudrate(options.baud)

workspace_tools/server.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ def handle(self):
139139
self.send_result("{error}")
140140
return
141141

142-
delete_dir_files(disk)
142+
if not target.is_disk_virtual:
143+
delete_dir_files(disk)
144+
143145
copy(image_path, disk)
144146

145147
# Copy Extra Files
146-
if test.extra_files:
148+
if not target.is_disk_virtual and test.extra_files:
147149
for f in test.extra_files:
148150
copy(f, disk)
149151

150-
sleep(target.program_cycle_s)
152+
sleep(target.program_cycle_s())
151153

152154
# Host test
153155
self.request.setblocking(0)

workspace_tools/targets.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ def __init__(self):
1212
# ARM Core
1313
self.core = None
1414

15-
# How much time (in seconds) it takes to the interface chip to flash a
16-
# new image and reset the target chip
17-
self.program_cycle_s = 1.5
15+
# Is the disk provided by the interface chip of this board virtual?
16+
self.is_disk_virtual = False
1817

1918
# list of toolchains that are supported by the mbed SDK for this target
2019
self.supported_toolchains = None
@@ -24,6 +23,9 @@ def __init__(self):
2423

2524
self.name = self.__class__.__name__
2625

26+
def program_cycle_s(self):
27+
return 4 if self.is_disk_virtual else 1.5
28+
2729
def get_labels(self):
2830
return [self.name, CORE_LABELS[self.core]] + self.extra_labels
2931

@@ -47,7 +49,7 @@ def __init__(self):
4749

4850
self.extra_labels = ['NXP', 'LPC176X']
4951

50-
self.supported_toolchains = ["ARM", "GCC_ARM", "GCC_CS", "GCC_CR", "IAR"]
52+
self.supported_toolchains = ["ARM", "uARM", "GCC_ARM", "GCC_CS", "GCC_CR", "IAR"]
5153

5254

5355
class LPC11U24(Target):
@@ -71,7 +73,7 @@ def __init__(self):
7173

7274
self.supported_toolchains = ["ARM"]
7375

74-
self.program_cycle_s = 4
76+
self.is_disk_virtual = True
7577

7678

7779
class KL25Z(Target):
@@ -84,7 +86,7 @@ def __init__(self):
8486

8587
self.supported_toolchains = ["ARM", "GCC_CW_EWL", "GCC_CW_NEWLIB"]
8688

87-
self.program_cycle_s = 4
89+
self.is_disk_virtual = True
8890

8991

9092
class LPC812(Target):
@@ -97,7 +99,7 @@ def __init__(self):
9799

98100
self.supported_toolchains = ["uARM"]
99101

100-
self.program_cycle_s = 4
102+
self.is_disk_virtual = True
101103

102104

103105
class LPC4088(Target):

0 commit comments

Comments
 (0)