Skip to content

Add a default 'profile' configuration #787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion mbed/mbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -1736,6 +1736,13 @@ def get_toolchain(self, toolchain=None):
error("Please specify toolchain using the -t switch or set default toolchain using command \"mbed toolchain\"", 1)
return tchain

def get_profile(self, profile=None):
if not profile:
profile_cfg = self.get_cfg('PROFILE')
if profile_cfg:
profile = [profile_cfg]
return profile

def set_defaults(self, target=None, toolchain=None):
if target and not self.get_cfg('TARGET'):
self.set_cfg('TARGET', target)
Expand Down Expand Up @@ -2638,6 +2645,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
target = program.get_target(target)
tchain = program.get_toolchain(toolchain)
macros = program.get_macros()
profile = program.get_profile(profile)

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