Skip to content

Commit c0ace9b

Browse files
committed
Add 'profile' configuration
1 parent e993263 commit c0ace9b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mbed/mbed.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1736,6 +1736,13 @@ def get_toolchain(self, toolchain=None):
17361736
error("Please specify toolchain using the -t switch or set default toolchain using command \"mbed toolchain\"", 1)
17371737
return tchain
17381738

1739+
def get_profile(self, profile=None):
1740+
if not profile:
1741+
profile_cfg = self.get_cfg('PROFILE')
1742+
if profile_cfg:
1743+
profile = [profile_cfg]
1744+
return profile
1745+
17391746
def set_defaults(self, target=None, toolchain=None):
17401747
if target and not self.get_cfg('TARGET'):
17411748
self.set_cfg('TARGET', target)
@@ -2638,6 +2645,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
26382645
target = program.get_target(target)
26392646
tchain = program.get_toolchain(toolchain)
26402647
macros = program.get_macros()
2648+
profile = program.get_profile(profile)
26412649

26422650
if compile_config:
26432651
# Compile configuration
@@ -3150,7 +3158,7 @@ def sterm(port=None, baudrate=None, echo=None, reset=False, sterm=True):
31503158
"Gets, sets or unsets mbed tool configuration options.\n"
31513159
"Options can be global (via the --global switch) or local (per program)\n"
31523160
"Global options are always overridden by local/program options.\n"
3153-
"Currently supported options: target, toolchain, protocol, depth, cache"))
3161+
"Currently supported options: target, toolchain, protocol, depth, cache, profile"))
31543162
def config_(var=None, value=None, global_cfg=False, unset=False, list_config=False):
31553163
name = var
31563164
var = str(var).upper()

0 commit comments

Comments
 (0)