2018-11-29 17:00:22 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
|
|
|
|
src = Split('''
|
|
|
|
CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cec.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_crc.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cryp_ex.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
|
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rng.c
|
2019-07-24 14:46:49 +08:00
|
|
|
STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
|
2018-11-29 17:00:22 +08:00
|
|
|
''')
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2023-12-03 01:32:27 +08:00
|
|
|
if GetDepend(['RT_USING_SERIAL']) or GetDepend(['RT_USING_NANO', 'RT_USING_CONSOLE']):
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_usart.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_I2C']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2c_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SPI']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_spi.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_qspi.c']
|
|
|
|
|
2021-10-14 19:40:01 +08:00
|
|
|
if GetDepend(['RT_USING_USB']):
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pccard.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd.c']
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pcd_ex.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_hcd.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_usb.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_CAN']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c']
|
|
|
|
|
2019-08-30 15:38:05 +08:00
|
|
|
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']) or GetDepend(['RT_USING_PULSE_ENCODER']):
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_tim_ex.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_lptim.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_eth.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_ADC']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_adc_ex.c']
|
|
|
|
|
2020-12-15 17:58:12 +08:00
|
|
|
if GetDepend(['RT_USING_DAC']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dac_ex.c']
|
|
|
|
|
2018-12-20 14:50:07 +08:00
|
|
|
if GetDepend(['RT_USING_RTC']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_WDT']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_iwdg.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_wwdg.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SDIO']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_sdmmc.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sd.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_AUDIO']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_i2s_ex.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sai_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_MTD_NOR']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nor.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_MTD_NAND']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_nand.c']
|
|
|
|
|
2019-01-14 16:37:29 +08:00
|
|
|
if GetDepend(['BSP_USING_FMC']):
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fmc.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_fsmc.c']
|
2019-01-14 16:37:29 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDRAM']):
|
2018-12-20 14:50:07 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sdram.c']
|
|
|
|
|
2018-12-26 10:24:43 +08:00
|
|
|
if GetDepend(['BSP_USING_EXT_FMC_IO']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_sram.c']
|
|
|
|
|
2018-12-20 14:50:07 +08:00
|
|
|
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c']
|
|
|
|
|
2019-01-14 16:37:29 +08:00
|
|
|
if GetDepend(['BSP_USING_LTDC']):
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_ltdc_ex.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma2d.c']
|
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_ll_dma2d.c']
|
2019-04-22 16:14:01 +08:00
|
|
|
src += ['STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dsi.c']
|
2019-01-14 16:37:29 +08:00
|
|
|
|
2018-11-29 17:00:22 +08:00
|
|
|
path = [cwd + '/STM32F4xx_HAL_Driver/Inc',
|
2022-05-07 03:50:57 +08:00
|
|
|
cwd + '/CMSIS/Device/ST/STM32F4xx/Include']
|
|
|
|
|
2018-11-29 17:00:22 +08:00
|
|
|
CPPDEFINES = ['USE_HAL_DRIVER']
|
2020-11-20 13:38:11 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
2018-11-29 17:00:22 +08:00
|
|
|
|
|
|
|
Return('group')
|