2018-12-13 10:56:09 +08:00
|
|
|
import os
|
2018-11-29 17:00:22 +08:00
|
|
|
import rtconfig
|
|
|
|
from building import *
|
|
|
|
|
|
|
|
cwd = GetCurrentDir()
|
|
|
|
|
2018-12-13 10:56:09 +08:00
|
|
|
# add general drivers
|
|
|
|
src = Glob('board.c')
|
2018-11-29 17:00:22 +08:00
|
|
|
src += Glob('CubeMX_Config/Src/stm32l4xx_hal_msp.c')
|
|
|
|
|
2018-12-13 10:56:09 +08:00
|
|
|
path = [cwd]
|
2018-11-29 17:00:22 +08:00
|
|
|
path += [cwd + '/CubeMX_Config/Inc']
|
|
|
|
|
2018-12-13 10:56:09 +08:00
|
|
|
if os.path.exists(cwd + '/../libraries'):
|
|
|
|
startup_path_prefix = cwd + '/../libraries'
|
|
|
|
else:
|
|
|
|
startup_path_prefix = cwd + '/../../libraries'
|
|
|
|
|
2018-11-29 17:00:22 +08:00
|
|
|
if rtconfig.CROSS_TOOL == 'gcc':
|
2018-12-13 10:56:09 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc/startup_stm32l475xx.s']
|
2018-11-29 17:00:22 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'keil':
|
2018-12-13 10:56:09 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/arm/startup_stm32l475xx.s']
|
2018-11-29 17:00:22 +08:00
|
|
|
elif rtconfig.CROSS_TOOL == 'iar':
|
2018-12-13 10:56:09 +08:00
|
|
|
src += [startup_path_prefix + '/STM32L4xx_HAL/CMSIS/Device/ST/STM32L4xx/Source/Templates/iar/startup_stm32l475xx.s']
|
2018-11-29 17:00:22 +08:00
|
|
|
|
|
|
|
CPPDEFINES = ['STM32L475xx']
|
|
|
|
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
|
|
|
|
|
|
|
|
Return('group')
|