rt-thread/bsp/stm32/stm32h750-weact-ministm32h7xx/board/SConscript

52 lines
1.6 KiB
Python

import os
import rtconfig
from building import *
Import('SDK_LIB')
objs = []
cwd = GetCurrentDir()
list = os.listdir(cwd)
path = [cwd]
path += [cwd + '/CubeMX_Config/Inc']
path += [cwd + '/port']
# add the general drivers.
src = Glob('board.c')
src += Glob('CubeMX_Config/Src/stm32h7xx_hal_msp.c')
if GetDepend(['BSP_USING_SPI_FLASH']):
src += Glob('port/drv_spi_flash.c')
if GetDepend(['BSP_USING_QSPI_FLASH']):
src += Glob('port/drv_qspi_flash.c')
if GetDepend('BSP_USING_LCD_SPI'):
src = src + ['port/drv_lcd_spi.c']
src = src + ['port/st7735/lcd.c']
src = src + ['port/st7735/st7735.c']
src = src + ['port/st7735/st7735_reg.c']
src = src + ['port/st7735/logo.c']
path += [cwd + '/port/st7735']
for item in list:
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
objs = objs + SConscript(os.path.join(item, 'SConscript'))
startup_path_prefix = SDK_LIB
if rtconfig.PLATFORM in ['gcc']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/gcc/startup_stm32h750xx.s']
elif rtconfig.PLATFORM in ['armcc', 'armclang']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/arm/startup_stm32h750xx.s']
elif rtconfig.PLATFORM in ['iccarm']:
src += [startup_path_prefix + '/STM32H7xx_HAL/CMSIS/Device/ST/STM32H7xx/Source/Templates/iar/startup_stm32h750xx.s']
# STM32H743xx || STM32H750xx || STM32F753xx
# You can select chips from the list above
CPPDEFINES = ['STM32H750xx']
group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)
Return('group')