Skip to content

Commit c3f4130

Browse files
authored
Merge pull request #4545 from theotherjimmy/uvision-whitelist
Filter support with a white list of post-bin hooks in uvision
2 parents a6828bb + 60fea42 commit c3f4130

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

tools/export/uvision/__init__.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from tools.arm_pack_manager import Cache
1111
from tools.targets import TARGET_MAP
12-
from tools.export.exporters import Exporter
12+
from tools.export.exporters import Exporter, filter_supported
1313
from tools.export.cmsis import DeviceCMSIS
1414

1515
cache_d = False
@@ -119,13 +119,19 @@ class Uvision(Exporter):
119119
"""
120120
NAME = 'uvision5'
121121
TOOLCHAIN = 'ARM'
122-
TARGETS = []
123-
for target, obj in TARGET_MAP.iteritems():
124-
if "ARM" not in obj.supported_toolchains:
125-
continue
126-
if not DeviceCMSIS.check_supported(target):
127-
continue
128-
TARGETS.append(target)
122+
123+
POST_BINARY_WHITELIST = set([
124+
"MCU_NRF51Code.binary_hook",
125+
"TEENSY3_1Code.binary_hook",
126+
"LPCTargetCode.lpc_patch",
127+
"LPC4088Code.binary_hook",
128+
"MTSCode.combine_bins_mts_dot",
129+
"MTSCode.combine_bins_mts_dragonfly",
130+
"NCS36510TargetCode.ncs36510_addfib"
131+
])
132+
TARGETS = [tgt for tgt in filter_supported("ARM", POST_BINARY_WHITELIST)
133+
if DeviceCMSIS.check_supported(tgt)]
134+
129135
#File associations within .uvprojx file
130136
file_types = {'.cpp': 8, '.c': 1, '.s': 2,
131137
'.obj': 3, '.o': 3, '.lib': 4,

0 commit comments

Comments
 (0)