2018-12-17 10:44:30 +08:00
|
|
|
import os
|
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
Import('SDK_LIB')
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# add general drivers
|
|
|
|
src = Split('''
|
|
|
|
board.c
|
|
|
|
CubeMX_Config/Src/stm32l4xx_hal_msp.c
|
|
|
|
''')
|
|
|
|
|
2022-08-19 09:03:44 +08:00
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
|
|
|
|
2021-10-25 01:08:48 +08:00
|
|
|
if GetDepend(['BSP_USING_KEY']):
|
|
|
|
src += Glob('ports/drv_key.c')
|
2021-04-17 16:28:09 +08:00
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
if GetDepend(['BSP_USING_QSPI_FLASH']):
|
|
|
|
src += Glob('ports/drv_qspi_flash.c')
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2022-08-19 09:03:44 +08:00
|
|
|
if GetDepend(['BSP_USING_FS']):
|
|
|
|
src += Glob('ports/drv_filesystem.c')
|
|
|
|
if GetDepend(['BSP_USING_SPI_FLASH_LITTLEFS']):
|
|
|
|
src += Glob('ports/fal/fal_spi_flash_sfud_port.c')
|
|
|
|
path += [cwd + '/ports/fal']
|
2018-12-17 10:44:30 +08:00
|
|
|
|
2023-01-09 10:33:38 +08:00
|
|
|
if GetDepend(['RT_USING_SENSOR']):
|
|
|
|
src += Glob('ports/drv_sensors.c')
|
2019-05-08 16:50:39 +08:00
|
|
|
|
2019-08-06 15:10:37 +08:00
|
|
|
if GetDepend(['BSP_USING_AUDIO']):
|
|
|
|
src += Glob('ports/audio/drv_es8388.c')
|
|
|
|
src += Glob('ports/audio/drv_sound.c')
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_AUDIO_RECORD']):
|
|
|
|
src += Glob('ports/audio/drv_mic.c')
|
|
|
|
|
2020-03-14 16:17:02 +08:00
|
|
|
if GetDepend(['BSP_USING_STM32_SDIO']):
|
2023-01-09 10:14:23 +08:00
|
|
|
src += Glob('ports/drv_sdio_adapter.c')
|
2020-03-14 16:17:02 +08:00
|
|
|
|
2022-08-19 09:03:44 +08:00
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
|
2019-08-06 15:10:37 +08:00
|
|
|
if GetDepend(['BSP_USING_AUDIO']):
|
|
|
|
path += [cwd + '/ports/audio']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
startup_path_prefix = SDK_LIB
|
|
|
|
|
2023-05-17 17:17:38 +08:00
|
|
|
if rtconfig.PLATFORM in ['gcc', 'llvm-arm']:
|
2018-12-17 10:44:30 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
|
2022-04-20 09:56:04 +08:00
|
|
|
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
|
2018-12-17 10:44:30 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
|
2022-05-31 06:11:15 +08:00
|
|
|
elif rtconfig.PLATFORM in ['iccarm']:
|
2018-12-17 10:44:30 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
|
|
|
|
|
2023-01-09 10:14:23 +08:00
|
|
|
CPPDEFINES = ['STM32L475xx']
|
2018-12-17 10:44:30 +08:00
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|