Skip to content

Commit be5a625

Browse files
author
Andriy.Lishchynskyi
committed
Resolved code review comments
1 parent 020c840 commit be5a625

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

tools/export/cdt/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from os.path import join, exists
2323
from os import makedirs, remove
2424
import shutil
25+
from copy import deepcopy
2526

2627
from tools.export.makefile import Makefile, GccArm, Armc5, IAR
2728

@@ -39,22 +40,19 @@ class Eclipse(Makefile):
3940
"""
4041
def get_target_config(self, ctx, configuration):
4142
"""Retrieve info from cdt_definitions.json"""
42-
tgt = TARGET_MAP[self.target]
43-
defaults = _CONFIGS_OPTIONS['default']
44-
eclipse_config = defaults['generic']
43+
tgt = deepcopy(TARGET_MAP[self.target])
44+
defaults = deepcopy(_CONFIGS_OPTIONS['default'])
45+
eclipse_config = deepcopy(defaults['generic'])
4546
if configuration in defaults:
4647
eclipse_config.update(defaults[configuration])
4748

4849
target_specific = _CONFIGS_OPTIONS['targets']
4950
if tgt.name in target_specific:
50-
eclipse_config.update(target_specific[tgt.name]['generic'])
51+
eclipse_config.update(target_specific[tgt.name]['generic'])
5152
if configuration in target_specific[tgt.name]:
52-
target_info.update(target_specific[tgt.name][configuration])
53-
54-
eclipse_config.update(target_info)
53+
eclipse_config.update(target_specific[tgt.name][configuration])
5554

56-
Eclipsedevice = namedtuple('Eclipsedevice', eclipse_config.keys())
57-
return Eclipsedevice(**eclipse_config)
55+
return eclipse_config
5856

5957
def generate(self):
6058
"""Generate Makefile, .cproject & .project Eclipse project file,
@@ -88,8 +86,7 @@ def generate(self):
8886
'{target}_{project}_{conf}_pyocd_settings.launch'.format(
8987
target=self.target,
9088
project=self.project_name,
91-
conf=launch_name,
92-
launch='pyocd_settings')))
89+
conf=launch_name)))
9390
# Generate launch configurations for GNU MCU Eclipse plug-in
9491
self.gen_file('cdt/%s' % 'pyocd_settings_gnu_mcu.tmpl', ctx, join('eclipse-extras',
9592
'{target}_{project}_{conf}.launch'.format(

0 commit comments

Comments
 (0)