SConscript 1.1 KB
Newer Older
H
Hao Zhu 已提交
1
import os
2 3 4
import rtconfig
from building import *

H
Hao Zhu 已提交
5 6
Import('SDK_LIB')

7 8
cwd = GetCurrentDir()

H
Hao Zhu 已提交
9 10 11 12 13
# add general drivers
src = Split('''
board.c
CubeMX_Config/Src/stm32f7xx_hal_msp.c
''')
14 15 16 17

if GetDepend(['BSP_USING_ETH']):
    src += Glob('ports/phy_reset.c')

H
Hao Zhu 已提交
18
if GetDepend(['BSP_USING_QSPI_FLASH']):
H
Hao Zhu 已提交
19
    src += Glob('ports/drv_qspi_flash.c')
20

H
Hao Zhu 已提交
21 22 23
if GetDepend(['BSP_USING_SDCARD']):
    src += Glob('ports/sdcard_port.c')

H
Hao Zhu 已提交
24
path =  [cwd]
25 26 27
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/ports']

H
Hao Zhu 已提交
28
startup_path_prefix = SDK_LIB
29

30
if rtconfig.PLATFORM in ['gcc']:
H
Hao Zhu 已提交
31
    src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/gcc/startup_stm32f767xx.s']
32
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
H
Hao Zhu 已提交
33
    src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/arm/startup_stm32f767xx.s']
34
elif rtconfig.CROSS_TOOL == 'iar':
H
Hao Zhu 已提交
35
    src += [startup_path_prefix + '/STM32F7xx_HAL/CMSIS/Device/ST/STM32F7xx/Source/Templates/iar/startup_stm32f767xx.s']
36 37 38 39 40

CPPDEFINES = ['STM32F767xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)

Return('group')