|
35 | 35 |
|
36 | 36 |
|
37 | 37 | # Application version
|
38 |
| -ver = '0.7.13' |
| 38 | +ver = '0.7.14' |
39 | 39 |
|
40 | 40 | # Default paths to Mercurial and Git
|
41 | 41 | hg_cmd = 'hg'
|
@@ -1253,27 +1253,28 @@ def get_mcu(self, mcu=None):
|
1253 | 1253 | target = mcu if mcu else target_cfg
|
1254 | 1254 | if target is None:
|
1255 | 1255 | error('Please specify compile target using the -m switch or set default target using command "target"', 1)
|
1256 |
| - elif not target_cfg: |
1257 |
| - self.set_cfg('TARGET', target) |
1258 | 1256 | return target
|
1259 | 1257 |
|
1260 | 1258 | def get_toolchain(self, toolchain=None):
|
1261 | 1259 | toolchain_cfg = self.get_cfg('TOOLCHAIN')
|
1262 | 1260 | tchain = toolchain if toolchain else toolchain_cfg
|
1263 | 1261 | if tchain is None:
|
1264 | 1262 | error('Please specify compile toolchain using the -t switch or set default toolchain using command "toolchain"', 1)
|
1265 |
| - elif not toolchain_cfg: |
1266 |
| - self.set_cfg('TOOLCHAIN', tchain) |
1267 | 1263 | return tchain
|
1268 | 1264 |
|
| 1265 | + def set_defaults(self, target=None, toolchain=None): |
| 1266 | + if target and not self.get_cfg('TARGET'): |
| 1267 | + self.set_cfg('TARGET', target) |
| 1268 | + if toolchain and not self.get_cfg('TOOLCHAIN'): |
| 1269 | + self.set_cfg('TOOLCHAIN', toolchain) |
| 1270 | + |
1269 | 1271 | def get_macros(self):
|
1270 | 1272 | macros = []
|
1271 | 1273 | if os.path.isfile('MACROS.txt'):
|
1272 | 1274 | with open('MACROS.txt') as f:
|
1273 | 1275 | macros = f.read().splitlines()
|
1274 | 1276 | return macros
|
1275 | 1277 |
|
1276 |
| - |
1277 | 1278 | # Global class, used for global config
|
1278 | 1279 | class Global(object):
|
1279 | 1280 | def __init__(self):
|
@@ -1953,6 +1954,8 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
|
1953 | 1954 | + args,
|
1954 | 1955 | env=env)
|
1955 | 1956 |
|
| 1957 | + program.set_defaults(target=target, toolchain=tchain) |
| 1958 | + |
1956 | 1959 |
|
1957 | 1960 | # Test command
|
1958 | 1961 | @subcommand('test',
|
@@ -2033,6 +2036,8 @@ def test_(toolchain=None, mcu=None, compile_list=False, run_list=False, compile_
|
2033 | 2036 | + args,
|
2034 | 2037 | env=env)
|
2035 | 2038 |
|
| 2039 | + program.set_defaults(target=target, toolchain=tchain) |
| 2040 | + |
2036 | 2041 |
|
2037 | 2042 | # Export command
|
2038 | 2043 | @subcommand('export',
|
@@ -2078,6 +2083,8 @@ def export(ide=None, mcu=None, source=False, clean=False, supported=False):
|
2078 | 2083 | + args,
|
2079 | 2084 | env=env)
|
2080 | 2085 |
|
| 2086 | + program.set_defaults(target=target) |
| 2087 | + |
2081 | 2088 |
|
2082 | 2089 | # Test command
|
2083 | 2090 | @subcommand('detect',
|
|
0 commit comments