diff --git a/tools/targets.py b/tools/targets.py index 1125ae3d82..3656b87fe8 100755 --- a/tools/targets.py +++ b/tools/targets.py @@ -58,7 +58,7 @@ def cached(func): class Target: # Cumulative attributes can have values appended to them, so they # need to be computed differently than regular attributes - __cumulative_attributes = ['extra_labels', 'macros'] + __cumulative_attributes = ['extra_labels', 'macros', 'features'] # {target_name: target_instance} map for all the targets in the system __target_map = {} diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 67ee57a2cf..82e0fd526e 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -324,6 +324,11 @@ class mbedToolchain: # Add target's symbols self.symbols += self.target.macros + # Add target's hardware + try : + self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features] + except AttributeError : + pass # Add extra symbols passed via 'macros' parameter self.symbols += self.macros