2017-08-22 15:52:57 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
|
|
|
|
src = Glob('GD32F4xx_standard_peripheral/Source/*.c')
|
|
|
|
src += [cwd + '/CMSIS/GD/GD32F4xx/Source/system_gd32f4xx.c']
|
|
|
|
|
|
|
|
#add for startup script
|
|
|
|
if rtconfig.CROSS_TOOL == 'gcc':
|
2019-04-18 10:07:48 +08:00
|
|
|
src += [cwd + '/CMSIS/GD/GD32F4xx/Source/GCC/startup_gd32f4xx.S']
|
2017-08-22 15:52:57 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'keil':
|
|
|
|
src += [cwd + '/CMSIS/GD/GD32F4xx/Source/ARM/startup_gd32f4xx.s']
|
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
|
|
|
src += [cwd + '/CMSIS/GD/GD32F4xx/Source/IAR/startup_gd32f4xx.s']
|
|
|
|
|
|
|
|
path = [
|
|
|
|
cwd + '/CMSIS/GD/GD32F4xx/Include',
|
|
|
|
cwd + '/CMSIS',
|
|
|
|
cwd + '/GD32F4xx_standard_peripheral/Include',]
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_BSP_USB']):
|
|
|
|
path += [cwd + '/GD32F4xx_usb_driver/Include']
|
|
|
|
src += [cwd + '/GD32F4xx_usb_driver/Source']
|
|
|
|
|
|
|
|
CPPDEFINES = ['USE_STDPERIPH_DRIVER', 'GD32F4XX']
|
|
|
|
|
2020-11-20 13:38:11 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
2017-08-22 15:52:57 +08:00
|
|
|
|
|
|
|
Return('group')
|