2022-05-06 09:28:21 +08:00
|
|
|
import os
|
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
Import('SDK_LIB')
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
|
|
|
board_config.c
|
|
|
|
''')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_TCA9539']):
|
|
|
|
src += Glob('ports/tca9539.c')
|
|
|
|
|
2024-01-09 21:56:37 +08:00
|
|
|
if GetDepend(['BSP_USING_SPI_FLASH']):
|
|
|
|
src += Glob('ports/drv_spi_flash.c')
|
|
|
|
|
2022-05-06 09:28:21 +08:00
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/ports']
|
2022-05-15 20:57:35 +08:00
|
|
|
path += [cwd + '/config']
|
2024-01-09 21:56:37 +08:00
|
|
|
path += [cwd + '/config/usb_config']
|
2022-05-06 09:28:21 +08:00
|
|
|
|
|
|
|
startup_path_prefix = SDK_LIB
|
|
|
|
|
2022-08-15 22:32:27 +08:00
|
|
|
if rtconfig.PLATFORM in ['gcc']:
|
2022-05-06 09:28:21 +08:00
|
|
|
src += [startup_path_prefix + '/hc32f4a0_ddl/drivers/cmsis/Device/HDSC/hc32f4xx/Source/GCC/startup_hc32f4a0.S']
|
2022-08-15 22:32:27 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2022-05-06 09:28:21 +08:00
|
|
|
src += [startup_path_prefix + '/hc32f4a0_ddl/drivers/cmsis/Device/HDSC/hc32f4xx/Source/ARM/startup_hc32f4a0.s']
|
2022-05-31 06:11:15 +08:00
|
|
|
elif rtconfig.PLATFORM in ['iccarm']:
|
2022-05-06 09:28:21 +08:00
|
|
|
src += [startup_path_prefix + '/hc32f4a0_ddl/drivers/cmsis/Device/HDSC/hc32f4xx/Source/IAR/startup_hc32f4a0.s']
|
|
|
|
|
2024-01-09 21:56:37 +08:00
|
|
|
CPPDEFINES = ['HC32F4A0', '__DEBUG']
|
2022-05-06 09:28:21 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|