Skip to content

Commit 9f628bb

Browse files
committed
use UID class from gnuarmeclipse exporter
use global UID class removed outcommented code
1 parent e4570db commit 9f628bb

File tree

1 file changed

+2
-21
lines changed

1 file changed

+2
-21
lines changed

tools/export/mcuxpresso/__init__.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from os.path import splitext, basename, exists
2929
from random import randint
3030

31-
from tools.export.gnuarmeclipse import GNUARMEclipse
31+
from tools.export.gnuarmeclipse import GNUARMEclipse, UID
3232
from tools.export.exporters import apply_supported_whitelist
3333
from tools.targets import TARGET_MAP
3434
from tools.utils import NotSupportedException
@@ -38,22 +38,6 @@
3838
# =============================================================================
3939

4040

41-
class UID:
42-
"""
43-
Helper class, used to generate unique ids required by .cproject symbols.
44-
"""
45-
@property
46-
def id(self):
47-
return "%0.9u" % randint(0, 999999999)
48-
49-
# Global UID generator instance.
50-
# Passed to the template engine, and referred as {{u.id}}.
51-
# Each invocation generates a new number.
52-
u = UID()
53-
54-
# =============================================================================
55-
56-
5741
POST_BINARY_WHITELIST = set([
5842
"TEENSY3_1Code.binary_hook",
5943
"MCU_NRF51Code.binary_hook",
@@ -201,13 +185,12 @@ def generate(self):
201185
opts['ld']['object_files'] = objects
202186
opts['ld']['user_libraries'] = self.libraries
203187
opts['ld']['system_libraries'] = self.system_libraries
204-
# opts['ld']['script'] = join(id.capitalize(),
205-
# "linker-script-%s.ld" % id)
206188
opts['ld']['script'] = self.ld_script
207189
opts['cpp_cmd'] = " ".join(toolchain.preproc)
208190

209191
# Unique IDs used in multiple places.
210192
# Those used only once are implemented with {{u.id}}.
193+
u = UID()
211194
uid = {}
212195
uid['config'] = u.id
213196
uid['tool_c_compiler'] = u.id
@@ -235,8 +218,6 @@ def generate(self):
235218
'.project', trim_blocks=True, lstrip_blocks=True)
236219
self.gen_file('mcuxpresso/{0}_cproject.tmpl'.format(target_name), jinja_ctx,
237220
'.cproject', trim_blocks=True, lstrip_blocks=True)
238-
# self.gen_file('mcuxpresso/makefile.targets.tmpl', jinja_ctx,
239-
# 'makefile.targets', trim_blocks=True, lstrip_blocks=True)
240221
self.gen_file('mcuxpresso/mbedignore.tmpl', jinja_ctx, '.mbedignore')
241222

242223
print

0 commit comments

Comments
 (0)