1import os 2import sys 3import rtconfig 4from building import * 5Import('rtconfig') 6 7tools_path = os.path.normpath(os.getcwd() + '../../..' + '/tools') 8sys.path.append(tools_path) 9from sdk_dist import get_source 10 11source_file_path = os.path.join(os.getcwd(), 'Source_file') 12base_path = 'library/HT32F1xxxx_Driver/src/' 13system_path = 'library/Device/Holtek/HT32F1xxxx/Source/' 14source_path = [] 15ic_list = [ 16 'HT32F1654', 17 'HT32F1656', 18 'HT32F12345', 19 'HT32F12364', 20 'HT32F12366' 21] 22 23cwd = GetCurrentDir() 24src = [] 25 26for ic_name in ic_list: 27 if GetDepend(['SOC_' + ic_name]): 28 source_path = get_source(ic_name,source_file_path,system_path,base_path) 29 30src = Split(source_path) 31 32path = [ 33 cwd + '/library/HT32F1xxxx_Driver/inc', 34 cwd + '/library/CMSIS/Include', 35 cwd + '/library/Device/Holtek/HT32F1xxxx/Include' 36] 37 38CPPDEFINES = ['USE_HT32_DRIVER'] 39 40group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 41 42Return('group') 43 44