Skip to content

Commit c6b51d7

Browse files
committed
Merge pull request #204 from theotherjimmy/1830-counterpart
added support for features array to build tools
2 parents b1aba7f + 1e71a28 commit c6b51d7

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

mbed.lib

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
https://github.com/mbedmicro/mbed/#974ecf731c8a5de78acc9e40573f2a7c7641c2cd
1+
https://github.com/mbedmicro/mbed/#d1ec4beabef320b48ec3cdad57e293ce7708f55f

tools/targets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def wrapper(*args, **kwargs):
5858
class Target:
5959
# Cumulative attributes can have values appended to them, so they
6060
# need to be computed differently than regular attributes
61-
__cumulative_attributes = ['extra_labels', 'macros']
61+
__cumulative_attributes = ['extra_labels', 'macros', 'features']
6262

6363
# {target_name: target_instance} map for all the targets in the system
6464
__target_map = {}

tools/toolchains/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,11 @@ def get_symbols(self):
324324

325325
# Add target's symbols
326326
self.symbols += self.target.macros
327+
# Add target's hardware
328+
try :
329+
self.symbols += ["DEVICE_" + feature + "=1" for feature in self.target.features]
330+
except AttributeError :
331+
pass
327332
# Add extra symbols passed via 'macros' parameter
328333
self.symbols += self.macros
329334

0 commit comments

Comments
 (0)