SConscript 1.0 KB
Newer Older
1
import os
2 3 4
import rtconfig
from building import *

S
SummerGift 已提交
5 6
Import('SDK_LIB')

7 8
cwd = GetCurrentDir()

9 10
# add general drivers
src =  Glob('board.c')
11 12 13 14 15 16 17 18
src += Glob('CubeMX_Config/Src/stm32f4xx_hal_msp.c')

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

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

19
path =  [cwd]
20
path += [cwd + '/CubeMX_Config/Inc']
21 22
path += [cwd + '/ports']

S
SummerGift 已提交
23
startup_path_prefix = SDK_LIB
24 25

if rtconfig.CROSS_TOOL == 'gcc':
26
    src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f429xx.s']
27
elif rtconfig.CROSS_TOOL == 'keil':
28
    src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/arm/startup_stm32f429xx.s']
29
elif rtconfig.CROSS_TOOL == 'iar':
30
    src += [startup_path_prefix + '/STM32F4xx_HAL/CMSIS/Device/ST/STM32F4xx/Source/Templates/iar/startup_stm32f429xx.s']
31 32 33 34 35

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

Return('group')