2022-07-22 15:05:14 +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("""
|
|
|
|
Device/Geehy/APM32F4xx/Source/system_apm32f4xx.c
|
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_gpio.c
|
2023-01-05 14:15:02 +08:00
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_syscfg.c
|
2022-07-22 15:05:14 +08:00
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_misc.c
|
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_rcm.c
|
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_usart.c
|
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_eint.c
|
2023-03-20 12:04:18 +08:00
|
|
|
APM32F4xx_StdPeriphDriver/src/apm32f4xx_dma.c
|
2022-07-22 15:05:14 +08:00
|
|
|
""")
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_ADC']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_adc.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_DAC']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_dac.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_RTC']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_rtc.c']
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_pmu.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SPI']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_spi.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_HWTIMER']) or GetDepend(['RT_USING_PWM']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_tmr.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2022-07-22 15:05:14 +08:00
|
|
|
if GetDepend(['RT_USING_WDT']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_wwdt.c']
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_iwdt.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
2023-03-20 12:04:18 +08:00
|
|
|
if GetDepend(['RT_USING_CAN']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_can.c']
|
|
|
|
|
|
|
|
if GetDepend(['RT_USING_SDIO']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_sdio.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDRAM']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_dmc.c']
|
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_ON_CHIP_FLASH']):
|
|
|
|
src += ['APM32F4xx_StdPeriphDriver/src/apm32f4xx_fmc.c']
|
|
|
|
|
2023-01-05 14:15:02 +08:00
|
|
|
if GetDepend(['BSP_USING_ETH']):
|
|
|
|
src += ['APM32F4xx_ETH_Driver/src/apm32f4xx_eth.c']
|
2023-01-09 10:14:23 +08:00
|
|
|
|
|
|
|
path = [cwd + '/Device/Geehy/APM32F4xx/Include',
|
2022-07-22 15:05:14 +08:00
|
|
|
cwd + '/APM32F4xx_StdPeriphDriver/inc',
|
2023-01-05 14:15:02 +08:00
|
|
|
cwd + '/CMSIS/Include',
|
|
|
|
cwd + '/APM32F4xx_ETH_Driver/inc']
|
2022-07-22 15:05:14 +08:00
|
|
|
|
|
|
|
CPPDEFINES = ['USE_STDPERIPH_DRIVER']
|
2023-03-20 12:04:18 +08:00
|
|
|
|
|
|
|
if GetDepend(['BSP_USING_SDRAM']):
|
|
|
|
CPPDEFINES += ['DATA_IN_ExtSRAM']
|
|
|
|
|
2022-07-22 15:05:14 +08:00
|
|
|
group = DefineGroup('Libraries', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|