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):
12391239 return mbed_tools_path
12401240
12411241 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
12431244 if target is None :
12441245 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 )
12451248 return target
12461249
12471250 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
12491253 if tchain is None :
12501254 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 )
12511257 return tchain
12521258
12531259 def get_macros (self ):
You can’t perform that action at this time.
0 commit comments