[tools][iar] 将IARPath作为独立函数
This commit is contained in:
parent
dc6b9fde98
commit
d1c66d0e30
34
tools/iar.py
34
tools/iar.py
|
@ -169,27 +169,27 @@ def IARProject(target, script):
|
|||
|
||||
IARWorkspace(target)
|
||||
|
||||
def IARPath():
|
||||
import rtconfig
|
||||
|
||||
# backup environ
|
||||
old_environ = os.environ
|
||||
os.environ['RTT_CC'] = 'iar'
|
||||
utils.ReloadModule(rtconfig)
|
||||
|
||||
# get iar path
|
||||
path = rtconfig.EXEC_PATH
|
||||
|
||||
# restore environ
|
||||
os.environ = old_environ
|
||||
utils.ReloadModule(rtconfig)
|
||||
|
||||
return path
|
||||
|
||||
def IARVersion():
|
||||
import subprocess
|
||||
import re
|
||||
|
||||
def IARPath():
|
||||
import rtconfig
|
||||
|
||||
# backup environ
|
||||
old_environ = os.environ
|
||||
os.environ['RTT_CC'] = 'iar'
|
||||
utils.ReloadModule(rtconfig)
|
||||
|
||||
# get iar path
|
||||
path = rtconfig.EXEC_PATH
|
||||
|
||||
# restore environ
|
||||
os.environ = old_environ
|
||||
utils.ReloadModule(rtconfig)
|
||||
|
||||
return path
|
||||
|
||||
path = IARPath()
|
||||
|
||||
if os.path.exists(path):
|
||||
|
|
Loading…
Reference in New Issue