2023-01-13 11:34:43 +08:00
|
|
|
import os
|
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
Import('SDK_LIB')
|
|
|
|
|
|
|
|
objs = []
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
list = os.listdir(cwd)
|
|
|
|
|
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
|
|
|
''')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SPI3_SAMPLE']):
|
|
|
|
src += Glob('ports/spi_sample.c')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_RW007']):
|
|
|
|
src += Glob('ports/drv_rw007.c')
|
|
|
|
|
2023-05-08 15:00:41 +08:00
|
|
|
if GetDepend(['BSP_USING_SLIDER_SAMPLE']):
|
2023-01-13 11:34:43 +08:00
|
|
|
src += Glob('ports/slider_sample.c')
|
|
|
|
|
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/ports']
|
|
|
|
|
|
|
|
startup_path_prefix = SDK_LIB
|
2024-05-24 17:09:02 +08:00
|
|
|
Tool_path = None
|
|
|
|
index = 'Infineon_mtb-pdl-cat1'
|
|
|
|
|
|
|
|
for filename in os.listdir(startup_path_prefix):
|
|
|
|
if index in filename:
|
|
|
|
Tool_path = os.path.join(startup_path_prefix, filename)
|
2023-01-13 11:34:43 +08:00
|
|
|
|
|
|
|
if rtconfig.PLATFORM in ['gcc']:
|
2024-05-24 17:09:02 +08:00
|
|
|
src += [Tool_path +
|
|
|
|
'/drivers/source/TOOLCHAIN_GCC_ARM/cy_syslib_ext.S']
|
2023-01-13 11:34:43 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armclang']:
|
2024-05-24 17:09:02 +08:00
|
|
|
src += [Tool_path +
|
|
|
|
'/drivers/source/TOOLCHAIN_ARM/cy_syslib_ext.S']
|
2023-01-13 11:34:43 +08:00
|
|
|
|
2023-04-11 15:40:48 +08:00
|
|
|
CPPDEFINES = ['CY8C6245LQI_S3D72', 'CORE_NAME_CM0P_0', 'CORE_NAME_CM4_0', 'CY_USING_PREBUILT_CM0P_IMAGE', 'CY_USING_HAL', 'COMPONENT_CAT1A', 'COMPONENT_CAT1', 'COMPONENT_BSP_DESIGN_MODUS']
|
2023-01-13 11:34:43 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend=[''], CPPPATH=path, CPPDEFINES=CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|