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
|
|
|
|
''')
|
|
|
|
|
2021-04-17 16:28:09 +08:00
|
|
|
if GetDepend('BSP_USING_KEY'):
|
|
|
|
src = src + ['ports/drv_key.c']
|
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
if GetDepend(['BSP_USING_QSPI_FLASH']):
|
|
|
|
src += Glob('ports/drv_qspi_flash.c')
|
2019-08-28 11:59:21 +08:00
|
|
|
|
|
|
|
if GetDepend('BSP_USING_SPI_LCD'):
|
|
|
|
src = src + ['ports/drv_lcd.c']
|
2018-12-17 10:44:30 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDCARD']):
|
2021-04-17 16:28:09 +08:00
|
|
|
src += Glob('ports/drv_sdcard.c')
|
2018-12-17 10:44:30 +08:00
|
|
|
|
2019-05-10 14:49:49 +08:00
|
|
|
if GetDepend(['BSP_USING_ICM20608']) or GetDepend(['BSP_USING_AHT10']):
|
2019-05-08 16:50:39 +08:00
|
|
|
src += Glob('ports/sensor_port.c')
|
|
|
|
|
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']):
|
|
|
|
src += Glob('ports/drv_sdio_adapter.c')
|
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
path = [cwd]
|
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
|
|
|
path += [cwd + '/ports']
|
|
|
|
|
2019-08-06 15:10:37 +08:00
|
|
|
if GetDepend(['BSP_USING_AUDIO']):
|
|
|
|
path += [cwd + '/ports/audio']
|
2020-03-14 16:17:02 +08:00
|
|
|
|
2018-12-17 10:44:30 +08:00
|
|
|
startup_path_prefix = SDK_LIB
|
|
|
|
|
|
|
|
if rtconfig.CROSS_TOOL == 'gcc':
|
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
|
|
|
|
elif rtconfig.CROSS_TOOL == 'keil':
|
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
|
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
|
|
|
|
|
|
|
|
CPPDEFINES = ['STM32L475xx']
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|