diff --git a/workspace_tools/targets.py b/workspace_tools/targets.py index 6fb1ca9c5a..097c5bbfc6 100755 --- a/workspace_tools/targets.py +++ b/workspace_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'] # Utility function: traverse a dictionary and change all the strings in the dictionary to # ASCII from Unicode. Needed because the original mbed target definitions were written in diff --git a/workspace_tools/toolchains/__init__.py b/workspace_tools/toolchains/__init__.py index d122fb72d1..97c6f20f6b 100644 --- a/workspace_tools/toolchains/__init__.py +++ b/workspace_tools/toolchains/__init__.py @@ -298,6 +298,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