22
22
from os .path import join , exists
23
23
from os import makedirs , remove
24
24
import shutil
25
+ from copy import deepcopy
25
26
26
27
from tools .export .makefile import Makefile , GccArm , Armc5 , IAR
27
28
@@ -39,22 +40,19 @@ class Eclipse(Makefile):
39
40
"""
40
41
def get_target_config (self , ctx , configuration ):
41
42
"""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' ])
45
46
if configuration in defaults :
46
47
eclipse_config .update (defaults [configuration ])
47
48
48
49
target_specific = _CONFIGS_OPTIONS ['targets' ]
49
50
if tgt .name in target_specific :
50
- eclipse_config .update (target_specific [tgt .name ]['generic' ])
51
+ eclipse_config .update (target_specific [tgt .name ]['generic' ])
51
52
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 ])
55
54
56
- Eclipsedevice = namedtuple ('Eclipsedevice' , eclipse_config .keys ())
57
- return Eclipsedevice (** eclipse_config )
55
+ return eclipse_config
58
56
59
57
def generate (self ):
60
58
"""Generate Makefile, .cproject & .project Eclipse project file,
@@ -88,8 +86,7 @@ def generate(self):
88
86
'{target}_{project}_{conf}_pyocd_settings.launch' .format (
89
87
target = self .target ,
90
88
project = self .project_name ,
91
- conf = launch_name ,
92
- launch = 'pyocd_settings' )))
89
+ conf = launch_name )))
93
90
# Generate launch configurations for GNU MCU Eclipse plug-in
94
91
self .gen_file ('cdt/%s' % 'pyocd_settings_gnu_mcu.tmpl' , ctx , join ('eclipse-extras' ,
95
92
'{target}_{project}_{conf}.launch' .format (
0 commit comments