mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1881 from mbedmicro/rename_features
Rename "features" to "device_has" in targets.jsonpull/1887/head
commit
bead0173d9
254
hal/targets.json
254
hal/targets.json
File diff suppressed because it is too large
Load Diff
|
@ -160,8 +160,8 @@ def add_to_targets(targets, device_file, verbose=False, remove=False) :
|
||||||
attrs = list(parse_attributes(device_file))
|
attrs = list(parse_attributes(device_file))
|
||||||
if attrs :
|
if attrs :
|
||||||
for t in target :
|
for t in target :
|
||||||
targets[t]["features"] = sorted(list(set(targets[t].setdefault("features",[]) + attrs)))
|
targets[t]["device_has"] = sorted(list(set(targets[t].setdefault("device_has",[]) + attrs)))
|
||||||
if verbose : print("[VERBOSE] target {} now features {}".format(t, attrs))
|
if verbose : print("[VERBOSE] target {} now device_has {}".format(t, attrs))
|
||||||
if remove is True:
|
if remove is True:
|
||||||
remove_attributes(device_file)
|
remove_attributes(device_file)
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ def cached(func):
|
||||||
class Target:
|
class Target:
|
||||||
# Cumulative attributes can have values appended to them, so they
|
# Cumulative attributes can have values appended to them, so they
|
||||||
# need to be computed differently than regular attributes
|
# 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
|
# 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
|
# ASCII from Unicode. Needed because the original mbed target definitions were written in
|
||||||
|
|
|
@ -298,7 +298,7 @@ class mbedToolchain:
|
||||||
|
|
||||||
# Add target's symbols
|
# Add target's symbols
|
||||||
self.symbols += self.target.macros
|
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
|
# Add extra symbols passed via 'macros' parameter
|
||||||
self.symbols += self.macros
|
self.symbols += self.macros
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue