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
# 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
path =  [cwd]
22
path += [cwd + '/CubeMX_Config/Inc']
23
path += [cwd + '/ports']
24

S
SummerGift 已提交
25
startup_path_prefix = SDK_LIB
26

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