1import os 2import rtconfig 3from building import * 4 5Import('SDK_LIB') 6 7cwd = GetCurrentDir() 8 9# add general drivers 10src = Split(''' 11board.c 12''') 13 14path = [cwd] 15path += [cwd + '/ports'] 16 17startup_path_prefix = SDK_LIB 18 19if rtconfig.PLATFORM in ['armcc', 'armclang']: 20 src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/arm/startup_apm32f10x_hd.s'] 21 22if rtconfig.PLATFORM in ['iccarm']: 23 src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/iar/startup_apm32f10x_hd.s'] 24 25if rtconfig.PLATFORM in ['gcc']: 26 src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/gcc/startup_apm32f10x_hd.S'] 27 28# APM32F10X_LD || APM32F10X_MD || APM32F10X_HD || APM32F10X_CL 29# You can select chips from the list above 30CPPDEFINES = ['APM32F10X_HD'] 31group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 32Return('group') 33