@@ -1739,6 +1739,13 @@ def get_toolchain(self, toolchain=None):
1739
1739
error ("Please specify toolchain using the -t switch or set default toolchain using command \" mbed toolchain\" " , 1 )
1740
1740
return tchain
1741
1741
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
+
1742
1749
def set_defaults (self , target = None , toolchain = None ):
1743
1750
if target and not self .get_cfg ('TARGET' ):
1744
1751
self .set_cfg ('TARGET' , target )
@@ -2641,6 +2648,7 @@ def compile_(toolchain=None, target=None, profile=False, compile_library=False,
2641
2648
target = program .get_target (target )
2642
2649
tchain = program .get_toolchain (toolchain )
2643
2650
macros = program .get_macros ()
2651
+ profile = program .get_profile (profile )
2644
2652
2645
2653
if compile_config :
2646
2654
# Compile configuration
@@ -3153,7 +3161,7 @@ def sterm(port=None, baudrate=None, echo=None, reset=False, sterm=True):
3153
3161
"Gets, sets or unsets mbed tool configuration options.\n "
3154
3162
"Options can be global (via the --global switch) or local (per program)\n "
3155
3163
"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 " ))
3157
3165
def config_ (var = None , value = None , global_cfg = False , unset = False , list_config = False ):
3158
3166
name = var
3159
3167
var = str (var ).upper ()
0 commit comments