2020-03-17 22:11:13 +08:00
|
|
|
import rtconfig
|
|
|
|
Import('RTT_ROOT')
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
# get current directory
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
|
|
|
# The set of source files associated with this SConscript file.
|
|
|
|
src = Split("""
|
|
|
|
CMSIS/Device/ST/STM32L1xx/Source/Templates/system_stm32L1xx.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_dma.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_cortex.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_crc.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_pwr.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_rcc.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_rcc_ex.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_cryp.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32l1xx_hal_cryp_ex.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_sram.c
|
|
|
|
STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_gpio.c
|
|
|
|
""")
|
|
|
|
|
|
|
|
|
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']):
|
2020-03-17 22:11:13 +08:00
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_uart.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_usart.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_I2C']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_i2c.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2020-03-17 22:11:13 +08:00
|
|
|
if GetDepend(['RT_USING_SPI']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_spi.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_ll_spi.c']
|
|
|
|
|
2021-10-14 19:40:01 +08:00
|
|
|
if GetDepend(['RT_USING_USB']):
|
2020-03-17 22:11:13 +08:00
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_pcd.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_pcd_ex.c']
|
2020-03-17 22:11:13 +08:00
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_ll_usb.c']
|
|
|
|
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_CAN']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_can.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']) or GetDepend(['RT_USING_PULSE_ENCODER']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_tim.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_tim_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_ADC']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_adc.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_adc_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_RTC']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_rtc.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_rtc_ex.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_WDT']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_iwdg.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_wwdg.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SDIO']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_ll_sdmmc.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_sd.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_AUDIO']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_i2s.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_flash.c']
|
|
|
|
src += ['STM32L1xx_HAL_Driver/Src/stm32L1xx_hal_flash_ex.c']
|
|
|
|
|
2023-01-09 10:14:23 +08:00
|
|
|
path = [cwd + '/CMSIS/Device/ST/STM32L1xx/Include',
|
2022-05-07 03:50:57 +08:00
|
|
|
cwd + '/STM32L1xx_HAL_Driver/Inc']
|
|
|
|
|
2020-03-17 22:11:13 +08:00
|
|
|
CPPDEFINES = ['USE_HAL_DRIVER']
|
2020-11-20 13:38:11 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
2020-03-17 22:11:13 +08:00
|
|
|
|
|
|
|
Return('group')
|