Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: export/uvision4.py
- Revision:
- 24:25bff2709c20
- Parent:
- 23:fbae331171fa
- Child:
- 29:1210849dba19
--- a/export/uvision4.py Sat Jul 16 22:51:17 2016 +0100
+++ b/export/uvision4.py Mon Aug 01 09:10:17 2016 +0100
@@ -17,7 +17,7 @@
from os.path import basename, join, dirname
from project_generator_definitions.definitions import ProGenDef
-from tools.export.exporters import Exporter
+from tools.export.exporters import Exporter, ExporterTargetsProperty
from tools.targets import TARGET_MAP, TARGET_NAMES
# If you wish to add a new target, add it to project_generator_definitions, and then
@@ -35,19 +35,20 @@
MBED_CONFIG_HEADER_SUPPORTED = True
- @property
- def TARGETS(self):
- if not hasattr(self, "_targets_supported"):
- self._targets_supported = []
+ @ExporterTargetsProperty
+ def TARGETS(cls):
+ if not hasattr(cls, "_targets_supported"):
+ cls._targets_supported = []
+ progendef = ProGenDef('uvision')
for target in TARGET_NAMES:
try:
- if (ProGenDef('uvision').is_supported(str(TARGET_MAP[target])) or
- ProGenDef('uvision').is_supported(TARGET_MAP[target].progen['target'])):
- self._targets_supported.append(target)
+ if (progendef.is_supported(str(TARGET_MAP[target])) or
+ progendef.is_supported(TARGET_MAP[target].progen['target'])):
+ cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet
continue
- return self._targets_supported
+ return cls._targets_supported
def get_toolchain(self):
return TARGET_MAP[self.target].default_toolchain