diff --git a/mbed.lib b/mbed.lib index e9f942e861..52eb89c753 100644 --- a/mbed.lib +++ b/mbed.lib @@ -1 +1 @@ -https://github.com/mbedmicro/mbed/#d7a196e89e14144bb749ebc9227f0704f4712323 +https://github.com/mbedmicro/mbed/#24e767c10f1beb4ad9d2496360ea972be2c02595 diff --git a/tools/targets.py b/tools/targets.py index 841419980a..5a3bcf0d4e 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', 'features'] + __cumulative_attributes = ['extra_labels', 'macros', 'device_has', 'features'] # {target_name: target_instance} map for all the targets in the system __target_map = {} diff --git a/tools/test/config_test/test01/mbed_app.json b/tools/test/config_test/test01/mbed_app.json index 1c6bdcf127..4a4246aa32 100644 --- a/tools/test/config_test/test01/mbed_app.json +++ b/tools/test/config_test/test01/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "b1": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "base1_1": "v_base1_1_b1", "base1_2": "v_base1_2_b1", diff --git a/tools/test/config_test/test02/mbed_app.json b/tools/test/config_test/test02/mbed_app.json index 00e9958c5f..3e3f0b38d6 100644 --- a/tools/test/config_test/test02/mbed_app.json +++ b/tools/test/config_test/test02/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "b1": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "base1_1": "v_base1_1_b1", "base1_2": "v_base1_2_b1", diff --git a/tools/test/config_test/test03/mbed_app.json b/tools/test/config_test/test03/mbed_app.json index 6f018e78f1..28b44b866a 100644 --- a/tools/test/config_test/test03/mbed_app.json +++ b/tools/test/config_test/test03/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "b1": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "base1_1": "v_base1_1_b1", "base1_2": "v_base1_2_b1", diff --git a/tools/test/config_test/test04/mbed_app.json b/tools/test/config_test/test04/mbed_app.json index 9c05453271..9753f36a4f 100644 --- a/tools/test/config_test/test04/mbed_app.json +++ b/tools/test/config_test/test04/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "b1": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "base1_1": "v_base1_1_b1", "base1_2": "v_base1_2_b1", @@ -21,8 +21,8 @@ } }, "b2": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "base2_1": "v_base2_1_b2", "base2_2": "v_base2_2_b2", diff --git a/tools/test/config_test/test05/mbed_app.json b/tools/test/config_test/test05/mbed_app.json index 7e67da9e4d..3dd12670d5 100644 --- a/tools/test/config_test/test05/mbed_app.json +++ b/tools/test/config_test/test05/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { - "core": "Cortex-M0", - "extra_labels": [] + "inherits": ["Target"], + "core": "Cortex-M0" }, "b1": { "inherits": ["base"], diff --git a/tools/test/config_test/test06/mbed_app.json b/tools/test/config_test/test06/mbed_app.json index 15462015ce..5025f659a8 100644 --- a/tools/test/config_test/test06/mbed_app.json +++ b/tools/test/config_test/test06/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { - "core": "Cortex-M0", - "extra_labels": [] + "inherits": ["Target"], + "core": "Cortex-M0" }, "b1": { "inherits": ["base"], diff --git a/tools/test/config_test/test07/mbed_app.json b/tools/test/config_test/test07/mbed_app.json index b1f7828442..c56f62402d 100644 --- a/tools/test/config_test/test07/mbed_app.json +++ b/tools/test/config_test/test07/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { - "core": "Cortex-M0", - "extra_labels": [] + "inherits": ["Target"], + "core": "Cortex-M0" }, "b1": { "inherits": ["base"], diff --git a/tools/test/config_test/test08/mbed_app.json b/tools/test/config_test/test08/mbed_app.json index 91d8a69e95..d4a4e87e92 100644 --- a/tools/test/config_test/test08/mbed_app.json +++ b/tools/test/config_test/test08/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "par1": "v_par1_base", "par2": "v_par2_base", diff --git a/tools/test/config_test/test09/mbed_app.json b/tools/test/config_test/test09/mbed_app.json index 9de52b63d1..57b0120048 100644 --- a/tools/test/config_test/test09/mbed_app.json +++ b/tools/test/config_test/test09/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { - "core": "Cortex-M0", - "extra_labels": [] + "inherits": ["Target"], + "core": "Cortex-M0" }, "b1": { "inherits": ["base"], diff --git a/tools/test/config_test/test10/mbed_app.json b/tools/test/config_test/test10/mbed_app.json index 2378db8a3e..16941f2bf3 100644 --- a/tools/test/config_test/test10/mbed_app.json +++ b/tools/test/config_test/test10/mbed_app.json @@ -1,8 +1,8 @@ { "custom_targets": { "base": { + "inherits": ["Target"], "core": "Cortex-M0", - "extra_labels": [], "config": { "par1": "v_par1_base", "par2": "v_par2_base", diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 124c62aa03..d272bf6c63 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -307,6 +307,7 @@ class mbedToolchain: # Target and Toolchain symbols labels = self.get_labels() self.symbols = ["TARGET_%s" % t for t in labels['TARGET']] + self.symbols.extend(["FEATURE_%s" % t for t in labels['FEATURE']]) self.symbols.extend(["TOOLCHAIN_%s" % t for t in labels['TOOLCHAIN']]) # Config support @@ -325,10 +326,9 @@ 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 + self.symbols += ["DEVICE_" + data + "=1" for data in self.target.device_has] + # Add target's features + self.symbols += ["FEATURE_" + data + "=1" for data in self.target.features] # Add extra symbols passed via 'macros' parameter self.symbols += self.macros @@ -348,6 +348,7 @@ class mbedToolchain: toolchain_labels.remove('mbedToolchain') self.labels = { 'TARGET': self.target.get_labels() + ["DEBUG" if "debug-info" in self.options else "RELEASE"], + 'FEATURE': self.target.features, 'TOOLCHAIN': toolchain_labels } return self.labels @@ -415,6 +416,7 @@ class mbedToolchain: if ((d.startswith('.') or d in self.legacy_ignore_dirs) or (d.startswith('TARGET_') and d[7:] not in labels['TARGET']) or + (d.startswith('FEATURE_') and d[8:] not in labels['FEATURE']) or (d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or (d == 'TESTS')): dirs.remove(d)