SConscript 1.1 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
# add general drivers
10 11 12 13
src = Split('''
board.c
CubeMX_Config/Src/stm32f1xx_hal_msp.c
''')
14 15 16 17 18 19 20

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

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

21 22 23
if GetDepend(['BSP_USING_SDCARD']):
    src += Glob('ports/sdcard_port.c')

24
path =  [cwd]
25
path += [cwd + '/CubeMX_Config/Inc']
26
path += [cwd + '/ports']
27

S
SummerGift 已提交
28
startup_path_prefix = SDK_LIB
29

30
if rtconfig.CROSS_TOOL == 'gcc':
31
    src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.s']
32
elif rtconfig.CROSS_TOOL == 'keil':
33
    src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/arm/startup_stm32f103xe.s']
34
elif rtconfig.CROSS_TOOL == 'iar':
35
    src += [startup_path_prefix + '/STM32F1xx_HAL/CMSIS/Device/ST/STM32F1xx/Source/Templates/iar/startup_stm32f103xe.s']
36 37 38 39
    
CPPDEFINES = ['STM32F103xE']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Return('group')