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 14if GetDepend(['BSP_USING_SPI_FLASH']): 15 src += Glob('ports/spi_flash_init.c') 16 17path = [cwd] 18path += [cwd + '/ports'] 19 20startup_path_prefix = SDK_LIB 21 22if rtconfig.PLATFORM in ['armcc', 'armclang']: 23 src += [startup_path_prefix + '/APM32F0xx_Library/Device/Geehy/APM32F0xx/Source/arm/startup_apm32f051.s'] 24 25if rtconfig.PLATFORM in ['iccarm']: 26 src += [startup_path_prefix + '/APM32F0xx_Library/Device/Geehy/APM32F0xx/Source/iar/startup_apm32f051.s'] 27 28if rtconfig.PLATFORM in ['gcc']: 29 src += [startup_path_prefix + '/APM32F0xx_Library/Device/Geehy/APM32F0xx/Source/gcc/startup_apm32f051.S'] 30 31# APM32F030x6 || APM32F030x8 || APM32F030xC 32# APM32F051x6 || APM32F051x8 33# APM32F070xB 34# APM32F071x8 || APM32F071xB 35# APM32F072x8 || APM32F072xB 36# APM32F091xB || APM32F091xC 37# You can select chips from the list above 38CPPDEFINES = ['APM32F051x8'] 39group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES) 40Return('group') 41