Skip to content

Commit 21389cd

Browse files
committed
Merge pull request #1563 from 0xc0170/fix_iar_rza1h
Progen data refactor
2 parents fb39286 + 6eabf37 commit 21389cd

File tree

6 files changed

+265
-3762
lines changed

6 files changed

+265
-3762
lines changed

workspace_tools/export/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def export(project_path, project_name, ide, target, destination='/tmp/',
8888
except AttributeError:
8989
pass
9090
if use_progen:
91-
if not ProGenDef(ide).is_supported(TARGET_MAP[target].progen_target):
91+
if not ProGenDef(ide).is_supported(TARGET_MAP[target].progen['target']):
9292
supported = False
9393
else:
9494
if target not in Exporter.TARGETS:

workspace_tools/export/exporters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def progen_get_project_data(self):
6464
'includes': {
6565
'Include Files': self.resources.headers + self.resources.inc_dirs,
6666
},
67-
'target': [TARGET_MAP[self.target].progen_target],
67+
'target': [TARGET_MAP[self.target].progen['target']],
6868
'macros': self.get_symbols(),
6969
'export_dir': [self.inputDir],
7070
'linker_file': [self.resources.linker_script],

workspace_tools/export/iar.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class IAREmbeddedWorkbench(Exporter):
3737
TARGETS = []
3838
for target in TARGET_NAMES:
3939
try:
40-
if (ProGenDef('iar').is_supported(TARGET_MAP[target]) or
41-
ProGenDef('iar').is_supported(TARGET_MAP[target].progen_target)):
40+
if (ProGenDef('iar').is_supported(str(TARGET_MAP[target])) or
41+
ProGenDef('iar').is_supported(TARGET_MAP[target].progen['target'])):
4242
TARGETS.append(target)
4343
except AttributeError:
4444
# target is not supported yet
@@ -47,19 +47,24 @@ class IAREmbeddedWorkbench(Exporter):
4747
def generate(self):
4848
""" Generates the project files """
4949
project_data = self.progen_get_project_data()
50+
tool_specific = {}
5051
# Expand tool specific settings by IAR specific settings which are required
51-
# by the mbed projects
52-
tool_specific = {
53-
'iar': {
54-
# We currently don't use misc, template sets those for us
55-
# 'misc': {
56-
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
57-
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
58-
# 'ld_flags': ['--skip_dynamic_initialization'],
59-
# },
60-
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
52+
try:
53+
if TARGET_MAP[self.target].progen['iar']['template']:
54+
tool_specific['iar'] = TARGET_MAP[self.target].progen['iar']
55+
except KeyError:
56+
# use default template
57+
# by the mbed projects
58+
tool_specific['iar'] = {
59+
# We currently don't use misc, template sets those for us
60+
# 'misc': {
61+
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
62+
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
63+
# 'ld_flags': ['--skip_dynamic_initialization'],
64+
# },
65+
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
6166
}
62-
}
67+
6368
project_data['tool_specific'] = {}
6469
project_data['tool_specific'].update(tool_specific)
6570
self.progen_gen_file('iar_arm', project_data)

0 commit comments

Comments
 (0)