Skip to content

Commit 8a6b4c1

Browse files
Merge pull request #787 from CyrillePierre/master
Add a default 'profile' configuration
2 parents ae35417 + c0ace9b commit 8a6b4c1

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
@@ -1739,6 +1739,13 @@ def get_toolchain(self, toolchain=None):
17391739
error("Please specify toolchain using the -t switch or set default toolchain using command \"mbed toolchain\"", 1)
17401740
return tchain
17411741

1742+
def get_profile(self, profile=None):
1743+
if not profile:
1744+
profile_cfg = self.get_cfg('PROFILE')
1745+
if profile_cfg:
1746+
profile = [profile_cfg]
1747+
return profile
1748+
17421749
def set_defaults(self, target=None, toolchain=None):
17431750
if target and not self.get_cfg('TARGET'):
17441751
self.set_cfg('TARGET', target)
@@ -2641,6 +2648,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
26412648
target = program.get_target(target)
26422649
tchain = program.get_toolchain(toolchain)
26432650
macros = program.get_macros()
2651+
profile = program.get_profile(profile)
26442652

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

0 commit comments

Comments
 (0)