[tools][iar] 将IARPath作为独立函数

This commit is contained in:
Meco Man 2022-09-17 14:31:01 -04:00 committed by Man, Jianting (Meco)
parent dc6b9fde98
commit d1c66d0e30
1 changed files with 17 additions and 17 deletions

View File

@ -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):