Rename "features" to "device_has" in targets.json

"features" will make more sense in the context of the feature support
that we'll introduce later (related to #1878). Plus, "device_has" is
arguably a better description of the actual content of this key.
pull/1881/head
Bogdan Marinescu 2016-06-08 18:28:05 +03:00
parent d7a196e89e
commit 05059a617f
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