2021-09-04 17:56:49 +08:00
|
|
|
# RT-Thread building script for bridge
|
|
|
|
|
|
|
|
import rtconfig
|
|
|
|
Import('RTT_ROOT')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
src = Split("""
|
|
|
|
CMSIS/Device/HDSC/HC32F460/Source/system_hc32f460.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_clk.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_efm.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_gpio.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_icg.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_interrupts.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_pwc.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_sram.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_utility.c
|
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_exint_nmi_swi.c
|
2022-05-10 13:54:15 +08:00
|
|
|
HC32F460_StdPeriph_Driver/src/hc32f460_rtc.c
|
2021-09-04 17:56:49 +08:00
|
|
|
""")
|
|
|
|
|
|
|
|
#src += Glob('HC32F460_StdPeriph_Driver/src/*.c')
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SERIAL']):
|
|
|
|
src += ['HC32F460_StdPeriph_Driver/src/hc32f460_usart.c']
|
|
|
|
|
|
|
|
#add for startup script
|
2022-04-20 09:56:04 +08:00
|
|
|
if rtconfig.PLATFORM == 'gcc':
|
2021-09-04 17:56:49 +08:00
|
|
|
src = src + ['CMSIS/Device/HDSC/HC32F460/Source/GCC/startup_hc32f460.S']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2021-09-04 17:56:49 +08:00
|
|
|
src = src + ['CMSIS/Device/HDSC/HC32F460/Source/ARM/startup_hc32f460.s']
|
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
|
|
|
src = src + ['CMSIS/Device/HDSC/HC32F460/Source/IAR/startup_hc32f460.s']
|
|
|
|
|
|
|
|
#add headfile script
|
|
|
|
path = [cwd + '/CMSIS/Include',
|
|
|
|
cwd + '/CMSIS/Device/HDSC/HC32F460/Include',
|
|
|
|
cwd + '/HC32F460_StdPeriph_Driver/inc']
|
|
|
|
|
|
|
|
|
|
|
|
CPPDEFINES = ['USE_DEVICE_DRIVER_LIB', rtconfig.MCU_TYPE, '__DEBUG']
|
|
|
|
|
|
|
|
group = DefineGroup('HC32_StdPeriph', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|