Merge pull request #1881 from mbedmicro/rename_features

Rename "features" to "device_has" in targets.json
pull/1887/head
Martin Kojtal 2016-06-09 11:32:21 +01:00
commit bead0173d9
4 changed files with 131 additions and 131 deletions

File diff suppressed because it is too large Load Diff

View File

@ -160,8 +160,8 @@ def add_to_targets(targets, device_file, verbose=False, remove=False) :
attrs = list(parse_attributes(device_file))
if attrs :
for t in target :
targets[t]["features"] = sorted(list(set(targets[t].setdefault("features",[]) + attrs)))
if verbose : print("[VERBOSE] target {} now features {}".format(t, attrs))
targets[t]["device_has"] = sorted(list(set(targets[t].setdefault("device_has",[]) + attrs)))
if verbose : print("[VERBOSE] target {} now device_has {}".format(t, attrs))
if remove is True:
remove_attributes(device_file)

View File

@ -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']
# 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

View File

@ -298,7 +298,7 @@ class mbedToolchain:
# Add target's symbols
self.symbols += self.target.macros
self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features]
self.symbols += ["DEVICE_" + data + "=1" for data in self.target.device_has]
# Add extra symbols passed via 'macros' parameter
self.symbols += self.macros