File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1239,15 +1239,21 @@ def get_tools(self):
1239
1239
return mbed_tools_path
1240
1240
1241
1241
def get_mcu (self , mcu = None ):
1242
- target = mcu if mcu else self .get_cfg ('TARGET' )
1242
+ target_cfg = self .get_cfg ('TARGET' )
1243
+ target = mcu if mcu else target_cfg
1243
1244
if target is None :
1244
1245
error ('Please specify compile target using the -m switch or set default target using command "target"' , 1 )
1246
+ elif not target_cfg :
1247
+ self .set_cfg ('TARGET' , target )
1245
1248
return target
1246
1249
1247
1250
def get_toolchain (self , toolchain = None ):
1248
- tchain = toolchain if toolchain else self .get_cfg ('TOOLCHAIN' )
1251
+ toolchain_cfg = self .get_cfg ('TOOLCHAIN' )
1252
+ tchain = toolchain if toolchain else toolchain_cfg
1249
1253
if tchain is None :
1250
1254
error ('Please specify compile toolchain using the -t switch or set default toolchain using command "toolchain"' , 1 )
1255
+ elif not toolchain_cfg :
1256
+ self .set_cfg ('TOOLCHAIN' , tchain )
1251
1257
return tchain
1252
1258
1253
1259
def get_macros (self ):
You can’t perform that action at this time.
0 commit comments