2021-09-03 11:50:17 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
|
|
|
|
src = Glob('GD32F10x_standard_peripheral/Source/*.c')
|
|
|
|
src += [cwd + '/CMSIS/GD/GD32F10x/Source/system_gd32f10x.c']
|
|
|
|
|
|
|
|
#add for startup script
|
2022-05-31 06:04:05 +08:00
|
|
|
if rtconfig.PLATFORM in ['gcc']:
|
2021-09-03 11:50:17 +08:00
|
|
|
src += [cwd + '/CMSIS/GD/GD32F10x/Source/GCC/startup_gd32f10x_cl.S']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2021-09-03 11:50:17 +08:00
|
|
|
src += [cwd + '/CMSIS/GD/GD32F10x/Source/ARM/startup_gd32f10x_cl.s']
|
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
|
|
|
src += [cwd + '/CMSIS/GD/GD32F10x/Source/IAR/startup_gd32f10x_cl.s']
|
|
|
|
|
|
|
|
path = [
|
|
|
|
cwd + '/CMSIS/GD/GD32F10x/Include',
|
|
|
|
cwd + '/CMSIS',
|
|
|
|
cwd + '/GD32F10x_standard_peripheral/Include',]
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_BSP_USB']):
|
|
|
|
path += [cwd + '/GD32F10x_usbfs_driver/Include']
|
|
|
|
src += [cwd + '/GD32F10x_usbfs_driver/Source']
|
|
|
|
|
|
|
|
CPPDEFINES = ['USE_STDPERIPH_DRIVER', 'GD32F10X_CL']
|
|
|
|
|
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|