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 + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/arm/startup_apm32f10x_cl.s']
24
25if rtconfig.PLATFORM in ['iccarm']:
26    src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/iar/startup_apm32f10x_cl.s']
27
28if rtconfig.PLATFORM in ['gcc']:
29    src += [startup_path_prefix + '/APM32F10x_Library/Device/Geehy/APM32F10x/Source/gcc/startup_apm32f10x_cl.S']
30
31# APM32F10X_LD || APM32F10X_MD || APM32F10X_HD || APM32F10X_CL
32# You can select chips from the list above
33CPPDEFINES = ['APM32F10X_CL']
34group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
35Return('group')
36